/* Resets & Base Styles */
:root {
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    --text-color-secondary: #666666;
    --accent-color: #2563eb;
    --accent-hover: #1d4ed8;
    --card-bg: #f3f4f6;
    --border-color: #e5e7eb;
    --nav-bg: rgba(255, 255, 255, 0.85);
    
    --font-heading: 'Display', 'Inter', sans-serif;
    --font-body: 'Inter', 'Noto Sans JP', sans-serif;
    
    --container-width: 1200px;
    --section-spacing: 120px;
    
    --transition-base: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

[data-theme="dark"] {
    --bg-color: #0f172a;
    --text-color: #f1f5f9;
    --text-color-secondary: #94a3b8;
    --accent-color: #38bdf8;
    --accent-hover: #0ea5e9;
    --card-bg: #1e293b;
    --border-color: #334155;
    --nav-bg: rgba(15, 23, 42, 0.85);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color var(--transition-base), color var(--transition-base);
    overflow-x: hidden;
}

/* Custom Cursor */
/* Only show on desktop */
@media (min-width: 1024px) {
    .cursor-dot, .cursor-dot-outline {
        position: fixed;
        top: 0;
        left: 0;
        transform: translate(-50%, -50%);
        border-radius: 50%;
        z-index: 9999;
        pointer-events: none;
    }
    
    .cursor-dot {
        width: 8px;
        height: 8px;
        background-color: var(--accent-color);
    }
    
    .cursor-dot-outline {
        width: 40px;
        height: 40px;
        border: 1px solid var(--accent-color);
        transition: width 0.2s, height 0.2s, background-color 0.2s;
    }
    
    body.hovering .cursor-dot-outline {
        width: 60px;
        height: 60px;
        background-color: rgba(37, 99, 235, 0.1);
        border-color: transparent;
    }
}

/* Utilities */
.container {
    width: 90%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: var(--section-spacing) 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 4px;
    background-color: var(--accent-color);
    border-radius: 2px;
}

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

ul {
    list-style: none;
}

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

.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 600;
    transition: all var(--transition-base);
    cursor: pointer;
}

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

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background-color: transparent;
    border: 2px solid var(--text-color);
    color: var(--text-color);
    margin-left: 1rem;
}

.btn-secondary:hover {
    background-color: var(--text-color);
    color: var(--bg-color);
}

/* Header & Nav */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background-color: var(--nav-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 1rem 0;
    transition: padding 0.3s;
}

.header.scrolled {
    padding: 0.8rem 0;
}

.header-container {
    
    justify-content: space-between;
    
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.05em;
}

.nav-list {
    
    gap: 2rem;
    
}

.nav-link {
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

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

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    
    
    padding: 5px;
}

.sun-icon { display: none; }
.moon-icon { display: block; }

[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }

.hamburger {
    display: none;
    cursor: pointer;
}

/* Hero Section */
.hero {
    
    
    
    position: relative;
    padding-top: 80px; /* Accounts for fixed header */
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    
}

.greeting {
    display: block;
    font-size: 1.25rem;
    color: var(--accent-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.name {
    font-size: 5rem;
    line-height: 1.1;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--text-color) 0%, var(--text-color-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.title {
    font-size: 1.5rem;
    color: var(--text-color-secondary);
    margin-bottom: 1.5rem;
}

.bio-short {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 2.5rem;
    color: var(--text-color-secondary);
    max-width: 500px;
}

.hero-image {
    
    justify-content: center;
    position: relative;
}

.profile-placeholder {
    width: 400px;
    height: 400px;
    border-radius: 30px;
    background: linear-gradient(45deg, var(--card-bg), var(--border-color));
    position: relative;
    overflow: hidden;
    box-shadow: 20px 20px 60px rgba(0,0,0,0.05);
    
    
    justify-content: center;
    
    transition: transform 0.5s ease;
}

.profile-placeholder:hover {
    transform: scale(1.02);
}

.profile-inner {
    font-size: 5rem;
    font-weight: 800;
    color: var(--text-color-secondary);
    opacity: 0.3;
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    
    flex-direction: column;
    
    opacity: 0.7;
}

.mouse {
    width: 26px;
    height: 40px;
    border: 2px solid var(--text-color);
    border-radius: 20px;
    margin-top: 8px;
    position: relative;
}

.wheel {
    width: 4px;
    height: 8px;
    background-color: var(--text-color);
    border-radius: 2px;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll 1.5s infinite;
}

@keyframes scroll {
    0% { transform: translate(-50%, 0); opacity: 1; }
    100% { transform: translate(-50%, 15px); opacity: 0; }
}

/* About Section */
.about-text {
    font-size: 1.1rem;
    color: var(--text-color-secondary);
    max-width: 800px;
}

.about-text p {
    margin-bottom: 1.5rem;
}

.skills {
    margin-top: 3rem;
}

.skills-title {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.pill-group {
    
    flex-wrap: wrap;
    gap: 10px;
}

.pill {
    padding: 8px 16px;
    background-color: var(--card-bg);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.pill:hover {
    background-color: var(--accent-color);
    color: white;
}

/* Research Section */
.research-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.card {
    background-color: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--border-color);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.05);
}

.card-image-wrapper {
    height: 200px;
    overflow: hidden;
}

.card-placeholder-image {
    width: 100%;
    height: 100%;
    transition: transform 0.5s;
}

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

.card-content {
    padding: 1.5rem;
}

.card-title {
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
}

.card-description {
    font-size: 0.95rem;
    color: var(--text-color-secondary);
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-tags {
    
    gap: 8px;
    margin-bottom: 1.5rem;
}

.card-tags span {
    font-size: 0.75rem;
    padding: 4px 10px;
    background-color: var(--bg-color);
    border-radius: 4px;
    color: var(--text-color-secondary);
}

.card-link {
    font-weight: 600;
    color: var(--accent-color);
    font-size: 0.9rem;
}

/* Publications Section */
.publication-list {
    
    flex-direction: column;
    gap: 2rem;
}

.pub-item {
    
    gap: 2rem;
    
    border-bottom: 1px solid var(--border-color);
}

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

.pub-year {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-color-secondary);
    min-width: 60px;
}

.pub-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.pub-venue {
    font-size: 1rem;
    color: var(--accent-color);
    font-style: italic;
    margin-bottom: 0.5rem;
}

.pub-authors {
    font-size: 0.95rem;
    color: var(--text-color-secondary);
    margin-bottom: 1rem;
}

.pub-links {
    
    gap: 1rem;
}

.pub-links a {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 4px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.pub-links a:hover {
    background-color: var(--text-color);
    color: var(--bg-color);
    border-color: var(--text-color);
}

/* Contact Section */
.contact-wrapper {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.contact-text {
    font-size: 1.2rem;
    color: var(--text-color-secondary);
    margin-bottom: 2rem;
}

.big-btn {
    padding: 16px 40px;
    font-size: 1.1rem;
}

.social-links {
    margin-top: 3rem;
    
    justify-content: center;
    gap: 2rem;
}

.social-links a {
    color: var(--text-color-secondary);
    font-weight: 600;
}

.social-links a:hover {
    color: var(--accent-color);
}

/* Footer */
.footer {
    padding: 3rem 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-color-secondary);
    font-size: 0.9rem;
}

/* Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s forwards;
}

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }

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

.fade-in-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

/* Mobile Responsive */
@media (max-width: 768px) {
    :root {
        --section-spacing: 80px;
    }

    .section-title {
        font-size: 2rem;
    }

    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    
    .hero-content {
        order: 2;
    }
    
    .hero-image {
        order: 1;
    }

    .profile-placeholder {
        width: 250px;
        height: 250px;
    }
    
    .name {
        font-size: 3rem;
    }
    
    .hero-buttons {
        
        flex-direction: column;
        gap: 1rem;
        
    }
    
    .btn-secondary {
        margin-left: 0;
    }
    
    .nav-list {
        display: none; /* simple hide for now, would need JS for hamburger */
    }
    
    .hamburger {
        display: block;
    }
    
    .pub-item {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Education (Timeline) */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 120px;
    height: 100%;
    width: 2px;
    background-color: var(--border-color);
}

.timeline-item {
    
    margin-bottom: 3rem;
    position: relative;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-date {
    width: 150px;
    padding-right: 30px;
    text-align: right;
    font-weight: 700;
    color: var(--accent-color);
    position: relative;
    flex-shrink: 0;
}

.timeline-date::after {
    content: '';
    position: absolute;
    top: 6px;
    right: -6px;
    width: 10px;
    height: 10px;
    background-color: var(--bg-color);
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    z-index: 1;
}

.timeline-content {
    padding-left: 30px;
    flex: 1;
}

.timeline-content h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.timeline-content p {
    font-size: 0.95rem;
    color: var(--text-color-secondary);
}

@media (max-width: 768px) {
    .timeline::before {
        left: 20px;
    }
    
    .timeline-item {
        flex-direction: column;
    }
    
    .timeline-date {
        width: 100%;
        text-align: left;
        padding-left: 40px;
        margin-bottom: 0.5rem;
    }
    
    .timeline-date::after {
        left: 16px;
        right: auto;
    }
    
    .timeline-content {
        padding-left: 40px;
    }
}

/* Compact Info Grid (About Section) */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 3rem;
    border-top: 1px solid var(--border-color);
    padding-top: 3rem;
}

.info-title {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    position: relative;
    padding-left: 15px;
}

.info-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 70%;
    background-color: var(--accent-color);
    border-radius: 2px;
}

.education-list {
    list-style: none;
}

.education-list li {
    
    margin-bottom: 1rem;
    font-size: 1rem;
}

.education-list .year {
    font-weight: 700;
    width: 150px;
    flex-shrink: 0;
    color: var(--text-color-secondary);
}

.education-list .school {
    color: var(--text-color);
}

/* Improve Pills */
.pill {
    background-color: transparent;
    border: 1px solid var(--border-color);
    padding: 8px 18px;
    border-radius: 50px;
}

.pill:hover {
    border-color: var(--accent-color);
    background-color: rgba(37, 99, 235, 0.05);
    color: var(--accent-color);
}

@media (max-width: 768px) {
    .info-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .education-list li {
        flex-direction: column;
    }
    
    .education-list .year {
        margin-bottom: 0.2rem;
    }
}

/* Profile Image */
.profile-image {
    width: 250px;
    height: 250px;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: 20px 20px 60px rgba(0,0,0,0.05);
    
    transition: transform 0.5s ease;
}

.profile-image:hover {
    transform: scale(1.02);
}

@media (max-width: 768px) {
    .profile-image {
        width: 200px;
        height: 200px;
    }
}

/* News Section */
.news-list {
    max-width: 900px;
    margin: 0 auto;
}

.news-item {
    
    align-items: flex-start;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.news-item:first-child {
    border-top: 1px solid var(--border-color);
}

.news-date {
    width: 150px;
    font-weight: 600;
    color: var(--text-color-secondary);
    flex-shrink: 0;
}

.news-content {
    
    align-items: baseline;
    gap: 1.5rem;
    flex: 1;
}

.news-tag {
    font-size: 0.8rem;
    padding: 4px 10px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-color);
    font-weight: 500;
    white-space: nowrap;
}

.news-text {
    line-height: 1.6;
}

@media (max-width: 768px) {
    .news-item {
        flex-direction: column;
        padding: 1.2rem 0;
    }

    .news-date {
        margin-bottom: 0.5rem;
    }

    .news-content {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Ensure Nav List is Horizontal */
.nav-list {
  display: flex;
  flex-direction: row; /* 明示的に指定 */
  gap: 2rem;
  align-items: center;
}

/* Mobile override needs to be specific */
@media (max-width: 768px) {
    .nav-list {
        display: none; /* 初期状態は非表示 */
        flex-direction: column; /* ハンバーガーメニュー展開時のみ縦 */
    }
}

/* Force horizontal layout for header container */
.header-container {
    display: flex;
    justify-content: space-between; /* Space out logo and nav/toggle */
    align-items: center;
    flex-wrap: nowrap; /* Prevent wrapping */
}

/* Ensure Nav and Toggle are grouped correctly or spaced well */
.nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-list {
    display: flex;
    flex-direction: row !important; /* Force row */
    gap: 2rem;
    margin: 0;
    padding: 0;
}
/* Custom cursor removed */

/* Force center alignment for hero image container */
.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}
