@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;800&family=Outfit:wght@400;700;900&display=swap');

:root {
    --bg-dark: #0a0a0f;
    --bg-darker: #050508;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --accent-cyan: #00f2fe;
    --accent-blue: #4facfe;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.15);
}

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

body.no-scroll {
    overflow: hidden !important;
    height: 100vh;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
.outfit {
    font-family: 'Outfit', sans-serif;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ==================================
   Header & Navbar
   ================================== */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    transition: background 0.4s ease, padding 0.4s ease;
    background: transparent;
    opacity: 0;
    visibility: hidden;
}

header.scrolled {
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 15px 50px;
    border-bottom: 1px solid var(--glass-border);
}

#logo img {
    height: 40px;
    transition: transform 0.3s;
}

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

#menubar ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

#menubar li {
    position: relative;
}

#menubar a {
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    transition: color 0.3s ease;
    padding: 5px 0;
}

#menubar a:hover,
#menubar a.active {
    color: var(--text-primary);
}

#menubar a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
    transition: width 0.3s ease;
}

#menubar a:hover::after {
    width: 100%;
}

/* Dropdown */
#menubar li ul {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 10px 0;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

#menubar li:hover ul {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

#menubar li ul li a {
    padding: 10px 20px;
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

#menubar li ul li a:hover {
    background: var(--glass-bg);
    color: var(--accent-cyan);
}

#menubar li ul li a::after {
    display: none;
}

/* ==================================
   Hero Section
   ================================== */
.hero {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Give enough specificity to show initially without !important blocking GSAP */
.hero.panel {
    visibility: visible;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(79, 172, 254, 0.15) 0%, rgba(10, 10, 15, 1) 70%);
    z-index: 1;
}

.hero-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    background-size: cover;
    background-position: center;
    filter: blur(2px) brightness(0.6);
}

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

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 20px;
}

.hero-title {
    font-size: 5vw;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.4), 0 0 40px rgba(0, 242, 254, 0.6);
    margin-bottom: 20px;
    letter-spacing: -2px;
    opacity: 1;
    /* Let GSAP handle animation */
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    font-weight: 300;
    letter-spacing: 2px;
    opacity: 1;
    /* Let GSAP handle animation */
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    animation: bounce 2s infinite;
    opacity: 0;
    /* Hide initially, let JS fade it in when ready to scroll */
    pointer-events: none;
}

.scroll-indicator::after {
    content: '';
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, var(--accent-cyan), transparent);
}

/* ==================================
   GSAP Full Page Pinned Setup
   ================================== */
#pin-master {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    margin: 0;
    padding: 0;
    max-width: none;
}

.panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    /* Center horizontally/vertically */
    z-index: 2;
    padding: 20px 0;
    /* pointer-events: none; GSAP can handle autoAlpha */
}

/* Specific to the horizontal GSAP sections on the top page */
#about-section,
#news-section,
#research-section,
#contact-section {
    visibility: hidden;
}

/* Ensure inner content is max-width 1200px and centered */
.panel>.section-header,
#about-section .about-grid,
#news-section .news-list,
.panel>small {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 40px;
}

.hero.panel {
    visibility: visible;
}

/* Background blob */
.blob {
    position: fixed;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(0, 242, 254, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    top: 20%;
    left: -20%;
    z-index: 0;
    /* Behind content */
    pointer-events: none;
}

.blob2 {
    left: auto;
    right: -20%;
    top: 60%;
    background: radial-gradient(circle, rgba(138, 43, 226, 0.05) 0%, transparent 70%);
    z-index: 0;
}

.section-header {
    margin-bottom: 60px;
    text-align: center;
}

.section-header h2 {
    font-size: 3rem;
    font-weight: 800;
    display: inline-block;
    position: relative;
    background: linear-gradient(90deg, #fff, var(--text-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue));
    border-radius: 2px;
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ==================================
   Secondary Pages / Research Content
   ================================== */
.page-content-wrapper {
    max-width: 900px;
    margin: 120px auto 60px;
    /* Leave space for fixed header */
    padding: 60px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    color: var(--text-secondary);
    line-height: 1.8;
}

.page-content-wrapper h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 40px;
    background: linear-gradient(90deg, #fff, var(--text-secondary));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
}

.page-content-wrapper h3 {
    font-size: 1.8rem;
    color: #fff;
    margin-top: 50px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.page-content-wrapper p {
    margin-bottom: 20px;
    font-size: 1.05rem;
}

strong.color-theme {
    color: var(--accent-cyan);
    font-weight: 700;
    font-size: 1.15rem;
    display: block;
    margin-bottom: 5px;
}

.page-content-wrapper figure,
.page-content-wrapper video {
    margin: 40px 0;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    max-width: 100%;
}

.page-content-wrapper figure img {
    width: 100%;
    height: auto;
    display: block;
}

/* ==================================
   About / Profile Section
   ================================== */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.profile-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.profile-card:hover {
    transform: translateY(-5px);
    border-color: var(--glass-highlight);
}

.profile-name {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: #fff;
}

.profile-lab {
    color: var(--accent-cyan);
    font-weight: 500;
    margin-bottom: 25px;
}

.timeline {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.timeline-item {
    display: flex;
    gap: 15px;
}

.timeline-year {
    color: var(--text-secondary);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    min-width: 80px;
}

.timeline-desc {
    color: #fff;
}

.profile-meta p {
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.profile-meta span {
    color: #fff;
    font-weight: 500;
}

.profile-images {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.profile-images img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 12px;
    transition: transform 0.4s ease, filter 0.4s ease;
    filter: grayscale(40%) brightness(0.8);
}

.profile-images img:nth-child(3) {
    grid-column: span 2;
    height: 250px;
}

.profile-images img:hover {
    transform: scale(1.02);
    filter: grayscale(0%) brightness(1.1);
    box-shadow: 0 10px 20px rgba(0, 242, 254, 0.2);
}

/* ==================================
   GSAP Specific Layouts
   ================================== */

/* Overwrite previous reveal classes since GSAP handles it */
.reveal {
    opacity: 1;
    transform: none;
    transition: none;
}

#research-section.panel .section-header {
    margin-top: 0px;
    margin-bottom: 20px;
}

.research-scroll-container {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    overflow: hidden;
    padding: 20px 0;
}

.research-track {
    display: flex;
    width: max-content;
    gap: 40px;
    padding: 20px 5vw;
}

.research-card {
    width: 600px;
    height: 400px;
    flex-shrink: 0;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: var(--bg-darker);
    border: 1px solid var(--glass-border);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
}

.news-scroll-container {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    /* Full width bleed out of the 1200px max container */
    overflow: hidden;
    padding: 20px 0;
}

.news-track {
    display: flex;
    width: max-content;
    gap: 30px;
    padding: 20px 5vw;
    /* Start with an offset */
}

.news-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 30px;
    width: 350px;
    height: 380px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
    position: relative;
    overflow: hidden;
}

.news-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
    z-index: 0;
    pointer-events: none;
}

.news-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(0, 242, 254, 0.2);
    border-color: rgba(0, 242, 254, 0.3);
}

.news-date-badge {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
    z-index: 1;
}

.news-date {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(90deg, #fff, var(--text-secondary));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.news-badge {
    display: inline-block;
    align-self: flex-start;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.badge-info {
    background: rgba(0, 242, 254, 0.1);
    color: var(--accent-cyan);
    border: 1px solid rgba(0, 242, 254, 0.2);
}

.badge-award {
    background: rgba(255, 215, 0, 0.1);
    color: #ffd700;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.badge-media {
    background: rgba(138, 43, 226, 0.1);
    color: #b86bfc;
    border: 1px solid rgba(138, 43, 226, 0.2);
}

.badge-misc {
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.news-content {
    flex: 1;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    z-index: 1;
}

.news-content a {
    color: var(--accent-blue);
    background-image: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
    background-size: 0% 1px;
    background-repeat: no-slash;
    background-position: left bottom;
    padding-bottom: 2px;
    transition: background-size 0.3s ease;
}

.news-content a:hover {
    background-size: 100% 1px;
    color: #fff;
}

/* ==================================
   Research Section
   ================================== */
#research-section {
    margin-top: 0;
}

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

.research-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: var(--bg-darker);
    border: 1px solid var(--glass-border);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
}

.research-card:hover {
    transform: translateY(-10px);
    border-color: rgba(0, 242, 254, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 242, 254, 0.1);
}

.research-img {
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.research-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.research-card:hover .research-img img {
    transform: scale(1.1);
}

.research-info {
    padding: 30px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.research-info h4 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #fff;
    transition: color 0.3s ease;
}

.research-card:hover .research-info h4 {
    color: var(--accent-cyan);
}

.research-info p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 20px;
    flex: 1;
}

.research-link {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--accent-blue);
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: gap 0.3s ease;
}

.research-card:hover .research-link {
    gap: 10px;
}

.research-link::after {
    content: '→';
    font-family: inherit;
}

/* ==================================
   Contact Section
   ================================== */
#contact-section {
    text-align: center;
    position: relative;
    /* For absolutely positioning the footer */
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.contact-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 40px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.contact-wrapper h2 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 30px;
    background: linear-gradient(135deg, #fff 0%, var(--accent-cyan) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.contact-desc {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 40px;
}

.contact-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.contact-btn {
    padding: 12px 30px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.contact-btn.primary {
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
}

.contact-btn.primary:hover {
    box-shadow: 0 8px 25px rgba(0, 242, 254, 0.5);
    transform: translateY(-3px);
}

.contact-btn.secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}

.contact-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
}

/* ==================================
   Footer (Integrated)
   ================================== */
.contact-footer {
    position: absolute;
    bottom: 20px;
    width: 100%;
    left: 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    opacity: 0.7;
}

.contact-footer a {
    color: var(--accent-cyan);
    text-decoration: none;
}

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

/* ==================================
   Animations
   ================================== */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0) translateX(-50%);
    }

    40% {
        transform: translateY(-15px) translateX(-50%);
    }

    60% {
        transform: translateY(-7px) translateX(-50%);
    }
}

/* ==================================
   Responsive
   ================================== */
@media (max-width: 900px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .hero-title {
        font-size: 3rem;
    }

    .news-item {
        flex-direction: column;
        gap: 15px;
    }

    .research-card {
        width: 400px;
        height: 350px;
    }

    .research-img {
        height: 180px;
    }
}

@media (max-width: 600px) {
    header {
        padding: 15px 20px;
    }

    header.scrolled {
        padding: 10px 20px;
    }

    #menubar {
        display: none;
        /* In a real scenario, use hamburger menu JS. For simplicity assuming basic responsive */
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .section-header h2 {
        font-size: 2.2rem;
    }

    .panel {
        padding: 60px 0 20px;
        /* More top padding so it clears the sticky header */
    }

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

    .profile-card {
        padding: 25px;
    }

    .research-card,
    .news-card {
        width: 280px;
        height: 380px;
    }

    .research-track,
    .news-track {
        gap: 20px;
    }

    .contact-wrapper {
        padding: 40px 20px;
        border-radius: 20px;
    }

    .contact-wrapper h2 {
        font-size: 2rem;
    }

    .contact-desc {
        font-size: 0.95rem;
    }

    .contact-actions {
        flex-direction: column;
        gap: 15px;
    }

    .contact-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==================================
   Rich Link Cards & Embeds
   ================================== */
.link-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.link-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-darker);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    text-decoration: none;
    color: var(--text-secondary);
}

.link-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4), 0 0 15px rgba(0, 242, 254, 0.1);
    border-color: rgba(0, 242, 254, 0.3);
}

.link-card-img {
    width: 100%;
    height: 160px;
    background-color: #1a1a24;
    overflow: hidden;
}

.link-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.link-card-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.link-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.link-card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
    margin-bottom: 10px;
}

.link-card-domain {
    font-size: 0.75rem;
    color: var(--accent-cyan);
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 5px;
}

.x-posts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
    justify-items: center;
}

/* =========================================================
   VERTICAL LAYOUT OVERRIDE (v9)
   採用担当が流し読みできる縦スクロール構成へ。
   演出は各セクションの reveal アニメで維持する。
   ここより下は、上の pinned/horizontal 用ルールを上書きする。
   ========================================================= */

html {
    scroll-behavior: smooth;
}

/* イントロのスクロールロックは廃止（ユーザーを足止めしない） */
body.no-scroll {
    overflow: visible !important;
    height: auto;
}

/* pin-master を通常フローに戻す */
#pin-master {
    position: relative;
    width: 100%;
    height: auto;
    overflow: visible;
}

/* パネルを通常フローの縦積みブロックに */
.panel {
    position: relative;
    width: 100%;
    height: auto;
    min-height: auto;
    top: auto;
    left: auto;
    padding: 120px 0;
    /* fixed header 分の余白を含む */
    scroll-margin-top: 90px;
    /* アンカー移動時にヘッダーへ潜り込まない */
}

/* 縦構成では常に見える状態を初期値にする（JSが無くても内容が読める） */
#about-section,
#news-section,
#research-section,
#projects-section,
#skills-section,
#publications-section,
#contact-section {
    visibility: visible;
}

/* Hero だけは全画面のまま演出を残す */
.hero.panel {
    height: 100vh;
    min-height: 600px;
    padding: 0;
}

/* Contact は画面いっぱいに固定していたのを解除 */
#contact-section {
    min-height: auto;
    padding-bottom: 60px;
}

.contact-footer {
    position: static;
    margin-top: 50px;
}

/* セクションの内側コンテンツ幅を統一 */
.panel > .section-header,
.section-inner {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 40px;
}

/* reveal 用（GSAP から from で動かす。JS 無効時は普通に見える） */
.reveal-up {
    will-change: transform, opacity;
}

/* News：縦構成では GSAP 横スクロールが無いので、自力で横スクロールできる帯にする */
.news-scroll-container {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    padding-bottom: 16px;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-blue) transparent;
}

.news-scroll-container::-webkit-scrollbar {
    height: 8px;
}

.news-scroll-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
}

.news-scroll-container::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
    border-radius: 8px;
}

.news-track {
    padding: 20px max(5vw, calc((100vw - 1200px) / 2 + 40px));
}

.news-card {
    scroll-snap-align: start;
}

/* 横スクロールできることを示すヒント */
.news-hint {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    letter-spacing: 1px;
    margin-top: 14px;
}

.news-hint i {
    color: var(--accent-cyan);
}

/* =========================================================
   Skills / 技術スタック
   ========================================================= */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

.skill-group {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 30px;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.skill-group:hover {
    transform: translateY(-5px);
    border-color: var(--glass-highlight);
}

.skill-group-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.skill-group-head i {
    font-size: 1.4rem;
    color: var(--accent-cyan);
}

.skill-group-head h4 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    transition: all 0.25s ease;
}

.skill-tag:hover {
    color: var(--accent-cyan);
    border-color: rgba(0, 242, 254, 0.4);
    background: rgba(0, 242, 254, 0.08);
}

/* 習熟度バー付きにしたい場合 */
.skill-tag.core {
    background: rgba(0, 242, 254, 0.1);
    border-color: rgba(0, 242, 254, 0.3);
    color: var(--accent-cyan);
}

/* =========================================================
   Projects / 開発実績（技術詳細つき）
   ========================================================= */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 30px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

.project-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-darker);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.4s ease, box-shadow 0.4s ease;
}

.project-card:hover {
    transform: translateY(-8px);
    border-color: rgba(0, 242, 254, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 242, 254, 0.1);
}

.project-thumb {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #12121a;
}

.project-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.project-card:hover .project-thumb img {
    transform: scale(1.08);
}

.project-award {
    position: absolute;
    top: 14px;
    left: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #ffd700;
    background: rgba(20, 20, 25, 0.8);
    border: 1px solid rgba(255, 215, 0, 0.4);
    backdrop-filter: blur(6px);
}

.project-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 26px;
}

.project-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}

.project-role {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-cyan);
    margin-bottom: 14px;
}

.project-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 18px;
    flex: 1;
}

.project-awards {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.project-awards .award-tag {
    font-size: 0.76rem;
    padding: 5px 11px;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.project-tags span {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 8px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
}

.project-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.project-links a,
.project-links button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-blue);
    transition: color 0.25s ease, gap 0.25s ease;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
}

.project-links a:hover,
.project-links button:hover {
    color: var(--accent-cyan);
    gap: 9px;
}

/* 「詳細」ボタンは少し目立たせる */
.project-links .detail-btn {
    padding: 7px 16px;
    border-radius: 20px;
    background: rgba(0, 242, 254, 0.1);
    border: 1px solid rgba(0, 242, 254, 0.28);
    color: var(--accent-cyan);
}

.project-links .detail-btn:hover {
    background: rgba(0, 242, 254, 0.18);
    gap: 6px;
}

/* =========================================================
   Project 詳細モーダル（ポップアップ）
   ========================================================= */
body.modal-open {
    overflow: hidden;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(4, 4, 8, 0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 6vh 20px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal {
    position: relative;
    width: 100%;
    max-width: 880px;
    margin: auto;
    background: linear-gradient(160deg, rgba(22, 22, 30, 0.98), rgba(10, 10, 15, 0.98));
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 44px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    transform: translateY(30px) scale(0.98);
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.open .modal {
    transform: translateY(0) scale(1);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s ease, transform 0.25s ease;
    z-index: 2;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: rotate(90deg);
}

.modal-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 6px;
    background: linear-gradient(90deg, #fff, var(--accent-cyan));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    padding-right: 40px;
}

.modal-sub {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 24px;
}

.modal-video {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 28px;
    border: 1px solid var(--glass-border);
    background: #000;
}

.modal-video iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.modal h4 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    margin: 28px 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal h4 i {
    color: var(--accent-cyan);
    font-size: 1rem;
}

.modal p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.85;
    margin-bottom: 12px;
}

.modal-awards {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.modal-figure {
    margin: 20px 0 0;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

.modal-figure img {
    width: 100%;
    display: block;
}

@media (max-width: 600px) {
    .modal {
        padding: 30px 22px;
        border-radius: 18px;
    }

    .modal-title {
        font-size: 1.6rem;
    }
}

/* =========================================================
   Publications & Awards
   ========================================================= */
.pub-wrap {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 40px;
    display: grid;
    gap: 40px;
}

.pub-block h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pub-block h3 i {
    color: var(--accent-cyan);
}

.pub-item {
    display: flex;
    gap: 20px;
    padding: 18px 0;
    border-bottom: 1px solid var(--glass-border);
}

.pub-item:last-child {
    border-bottom: none;
}

.pub-date {
    flex-shrink: 0;
    min-width: 90px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.pub-detail {
    color: var(--text-primary);
    font-size: 0.98rem;
    line-height: 1.6;
}

.pub-detail .pub-venue {
    color: var(--accent-cyan);
    font-weight: 600;
}

.pub-detail .pub-prize {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.25);
    vertical-align: middle;
}

.pub-detail a {
    color: var(--accent-blue);
    transition: color 0.25s ease;
}

.pub-detail a:hover {
    color: var(--accent-cyan);
    text-decoration: underline;
}

/* Awards：賞名をタグ化したカードグリッド */
.pub-heading {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 26px;
    padding: 0 40px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pub-heading i {
    color: #ffd700;
}

.awards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 22px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

.award-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    padding: 24px;
    position: relative;
    color: inherit;
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.35s ease, box-shadow 0.35s ease;
}

.award-card:hover {
    transform: translateY(-6px);
    border-color: rgba(255, 215, 0, 0.35);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.45), 0 0 20px rgba(255, 215, 0, 0.08);
}

.award-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.award-year {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
}

.award-icon {
    color: #ffd700;
    opacity: 0.85;
    font-size: 1.1rem;
}

a.award-card .award-icon.link-icon {
    font-size: 0.9rem;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

a.award-card:hover .award-icon.link-icon {
    opacity: 1;
    color: var(--accent-cyan);
}

.award-venue {
    font-size: 1.08rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.45;
}

.award-work {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.award-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding-top: 6px;
}

.award-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 6px 13px;
    border-radius: 20px;
    color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.28);
    letter-spacing: 0.3px;
}

/* 学内表彰など、コンペ賞と区別したいタグ */
.award-tag.univ {
    color: var(--accent-cyan);
    background: rgba(0, 242, 254, 0.1);
    border-color: rgba(0, 242, 254, 0.28);
}

/* 最優秀系のカードを強調 */
.award-card.featured {
    border-color: rgba(255, 215, 0, 0.4);
    background: linear-gradient(160deg, rgba(255, 215, 0, 0.06), var(--glass-bg) 60%);
}

.award-card.featured::before {
    content: 'BEST';
    position: absolute;
    top: 0;
    right: 0;
    font-family: 'Outfit', sans-serif;
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 1.5px;
    color: #0a0a0f;
    background: linear-gradient(90deg, #ffe680, #ffd700);
    padding: 4px 10px;
    border-radius: 0 18px 0 12px;
}

.award-card.featured:hover {
    border-color: rgba(255, 215, 0, 0.6);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.45), 0 0 26px rgba(255, 215, 0, 0.16);
}

/* 最優秀の賞名タグ（一段強い金色） */
.award-tag.top {
    color: #0a0a0f;
    background: linear-gradient(90deg, #ffe680, #ffd700);
    border-color: #ffd700;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.25);
}

/* Presentations：年ごとの発表・出展先をタグ表示 */
.pub-item {
    align-items: center;
}

.pres-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pres-tag {
    font-size: 0.82rem;
    font-weight: 600;
    padding: 5px 13px;
    border-radius: 8px;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    transition: border-color 0.25s ease, color 0.25s ease;
}

.pres-tag:hover {
    color: var(--accent-cyan);
    border-color: rgba(0, 242, 254, 0.4);
}

/* =========================================================
   Mobile hamburger nav
   ========================================================= */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    width: 40px;
    height: 40px;
    position: relative;
    z-index: 1100;
}

.nav-toggle span {
    display: block;
    position: absolute;
    left: 8px;
    width: 24px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease, top 0.3s ease;
}

.nav-toggle span:nth-child(1) {
    top: 13px;
}

.nav-toggle span:nth-child(2) {
    top: 19px;
}

.nav-toggle span:nth-child(3) {
    top: 25px;
}

body.nav-open .nav-toggle span:nth-child(1) {
    top: 19px;
    transform: rotate(45deg);
}

body.nav-open .nav-toggle span:nth-child(2) {
    opacity: 0;
}

body.nav-open .nav-toggle span:nth-child(3) {
    top: 19px;
    transform: rotate(-45deg);
}

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

    header {
        padding: 14px 20px;
    }

    #logo img {
        height: 26px;
        max-width: 60vw;
        width: auto;
        object-fit: contain;
    }

    #menubar {
        position: fixed;
        top: 0;
        right: 0;
        width: min(78vw, 320px);
        height: 100vh;
        background: rgba(8, 8, 12, 0.96);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-left: 1px solid var(--glass-border);
        transform: translateX(100%);
        transition: transform 0.35s cubic-bezier(0.5, 0, 0, 1);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1050;
    }

    body.nav-open #menubar {
        transform: translateX(0);
    }

    #menubar ul {
        flex-direction: column;
        align-items: flex-start;
        gap: 26px;
        padding: 0 40px;
    }

    #menubar a {
        font-size: 1.2rem;
    }

    /* モバイルではドロップダウンを常時展開 */
    #menubar li ul {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        background: none;
        border: none;
        padding: 12px 0 0 16px;
        min-width: 0;
    }
}

/* =========================================================
   動きを減らす設定のユーザーへの配慮
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }

    .scroll-indicator {
        animation: none;
    }
}