/* ===========================
   Global Styles
   =========================== */

:root {
    --primary: #2d3436;
    --secondary: #35a49c;
    --accent: #f39c12;
    --text: #2c3e50;
    --text-light: #7f8c8d;
    --bg: #ffffff;
    --bg-light: #f8f9fa;
    --border: #ecf0f1;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text);
    background-color: var(--bg);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

/* ===========================
   Typography
   =========================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: 3.5rem;
    font-weight: 700;
}

h2 {
    font-size: 2.5rem;
    font-weight: 700;
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

h4 {
    font-size: 1.1rem;
    font-weight: 600;
}

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

a {
    color: var(--secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

/* ===========================
   Layout
   =========================== */

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

.section {
    padding: 5rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text);
    position: relative;
    padding-bottom: 1rem;
}

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

/* ===========================
   Navigation
   =========================== */

.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    transition: color 0.3s ease;
}

.nav-logo:hover {
    color: var(--secondary);
}

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

.nav-link {
    color: var(--text);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--secondary);
}

/* ===========================
   Hero Section
   =========================== */

.hero {
    margin-top: 80px;
    padding: 8rem 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #ecf0f1 100%);
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero-content h1 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 3.5rem;
}

.hero-content p {
    font-size: 1.5rem;
    color: var(--text-light);
    margin-bottom: 2.5rem;
    font-weight: 400;
}

.hero-cta {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===========================
   Buttons
   =========================== */

.btn {
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    display: inline-block;
}

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

.btn-primary:hover {
    background-color: #2a9d96;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(53, 164, 156, 0.3);
}

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

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

/* ===========================
   About Section
   =========================== */

.about {
    background-color: var(--bg-light);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

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

.about-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

@media (min-width: 768px) {
    .about-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

@media (min-width: 1024px) {
    .about-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

.about-item h4 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.about-item p {
    color: var(--text-light);
    font-size: 0.95rem;
}

.date {
    display: block;
    color: var(--secondary);
    font-weight: 600;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

/* ===========================
   Works Section
   =========================== */

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

@media (min-width: 1024px) {
    .works-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.work-item {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.work-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.work-image {
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.work-content {
    padding: 2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.work-content h3 {
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.work-content p {
    flex-grow: 1;
    margin-bottom: 1rem;
    color: var(--text-light);
}

.work-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.tag {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    background-color: var(--bg-light);
    color: var(--secondary);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.work-link {
    color: var(--secondary);
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

.work-link:hover {
    transform: translateX(4px);
}

/* ===========================
   Skills Section
   =========================== */

.skills {
    background-color: white;
}

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

.skill-category h4 {
    color: var(--primary);
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--secondary);
    padding-bottom: 0.5rem;
}

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

.skill-tag {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: var(--bg-light);
    color: var(--text);
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.skill-tag:hover {
    background-color: var(--secondary);
    color: white;
    border-color: var(--secondary);
}

/* ===========================
   Experience Section
   =========================== */

.experience {
    background-color: var(--bg-light);
}

.timeline {
    max-width: 700px;
    margin: 0 auto;
}

.timeline-item {
    padding: 2rem;
    margin-bottom: 2rem;
    border-left: 4px solid var(--secondary);
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    padding-left: 3rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 2rem;
    width: 20px;
    height: 20px;
    background-color: var(--secondary);
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 0 0 4px var(--secondary);
}

.timeline-content h4 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.role-company {
    color: var(--secondary);
    font-weight: 600;
    font-size: 0.95rem;
}

.timeline-date {
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.timeline-item ul {
    list-style: none;
    padding-left: 0;
}

.timeline-item li {
    padding-left: 1.5rem;
    position: relative;
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.timeline-item li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--secondary);
    font-weight: bold;
}

/* ===========================
   Outputs Section (レイアウト修正)
   =========================== */

.outputs-list {
    display: grid;
    /* auto-fit ではなく 3列固定(1fr 1fr 1fr) に設定 */
    grid-template-columns: repeat(3, 1fr); 
    gap: 2rem;
    margin-top: 2rem;
    align-items: stretch; /* 高さを自動で揃える */
}

/* モバイル対応：画面幅が 992px 以下の時は 1列にする（お好みで 768px などに調整可） */
@media (max-width: 992px) {
    .outputs-list {
        grid-template-columns: 1fr;
    }
}

.publication-item {
    padding: 2rem;
    background-color: var(--bg-light);
    border-radius: 12px;
    border-left: 4px solid var(--secondary);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* ===========================
   Contact Section
   =========================== */

.contact {
    background: linear-gradient(135deg, #f8f9fa 0%, #ecf0f1 100%);
}

.contact-content {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.contact-content > p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.contact-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.contact-item h4 {
    color: var(--primary);
    margin-bottom: 1rem;
}

.contact-item a {
    display: block;
    color: var(--secondary);
    font-weight: 600;
    margin: 0.5rem 0;
    transition: all 0.3s ease;
}

.contact-item a:hover {
    transform: translateX(4px);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.social-links a {
    padding: 0.5rem 1rem;
    background-color: white;
    border-radius: 25px;
    border: 2px solid var(--secondary);
}

.social-links a:hover {
    background-color: var(--secondary);
    color: white;
    transform: none;
}

.contact-form-container {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.contact-form-container iframe {
    border: none;
    border-radius: 12px;
}

/* ===========================
   Footer
   =========================== */

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

.footer p {
    margin-bottom: 0;
    color: rgba(255, 255, 255, 0.8);
}

/* ===========================
   Responsive Design
   =========================== */

@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 1.8rem;
    }

    .section {
        padding: 3rem 0;
    }

    .nav-menu {
        gap: 1rem;
    }

    .nav-link {
        font-size: 0.85rem;
    }

    .hero {
        margin-top: 60px;
        padding: 4rem 0;
        min-height: auto;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 1.1rem;
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .hero-cta .btn {
        width: 100%;
        max-width: 300px;
    }

    .about-content {
        grid-template-columns: 1fr;
    }

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

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

    .contact-methods {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.4rem;
    }

    .container {
        padding: 0 1rem;
    }

    .section {
        padding: 2rem 0;
    }

    .nav-logo {
        font-size: 1.2rem;
    }

    .nav-menu {
        gap: 0.75rem;
        font-size: 0.8rem;
    }

    .timeline-item {
        margin-bottom: 1.5rem;
    }

    .work-tags {
        gap: 0.4rem;
    }

    .tag {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }

    .skill-list {
        gap: 0.5rem;
    }

    .skill-tag {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
}

/* ===========================
   Animations
   =========================== */

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

.work-item,
.skill-category,
.publication-item {
    animation: fadeInUp 0.6s ease-out;
}
