html {
    scroll-snap-type: y mandatory;
}

body {
    font-family: 'Zen Maru Gothic', sans-serif;
    color: #474747;
    user-select: none;
    margin: 0;
}

#welcome {
    background-color: #fafafa;
}

#profile, #works, #contact {
    background-color: #fff;
}

.welcome-text {
    font-size: 2.5em;
    font-weight: bold;
    animation: fadeIn 3s ease-in-out;
}

.sub-text {
    font-size: 1.0em;
    margin-top: 10px;
    color: #777;
    animation: fadeIn 3s ease-in-out;
}

@media (max-width: 768px) {
    .welcome-text {
        font-size: 1.8em;
    }

    .sub-text {
        font-size: 0.9em;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

header {
    position: sticky;
    top: 0;
    background: #fff;
    padding: 10px 50px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.logo {
    font-weight: bold;
    font-size: 1.5em;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

nav ul li {
    margin: 0 20px;
}

nav ul li a {
    text-decoration: none;
    color: #555;
    font-weight: bold;
}

section {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    scroll-snap-align: start;
}

h2 {
    font-size: 1.5em;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

footer {
    text-align: center;
    padding: 20px;
    background-color: #333;
    color: #fff;
}

/* Google Fontsの読み込み */
@import url('https://fonts.googleapis.com/css2?family=Zen+Maru+Gothic:wght@400;700&display=swap');

.hamburger {
    display: none;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #333;
    margin: 5px 25px;
    transition: 0.4s;
}


@media (max-width: 768px) {
    header {
        height: 50px;
    }

    .logo {
        font-size: 1.2em;
    }

    nav ul li a:hover {
        color: #333;
    }

    .hamburger {
        display: block;
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 200;
    }

    .global-nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: rgba(255, 255, 255, 0.95);
        display: flex;
        justify-content: center;
        align-items: center;
        transform: translateX(100%);
        transition: transform 0.5s ease-in-out;
    }

    .global-nav.active {
        transform: translateX(0);
    }

    nav ul {
        flex-direction: column;
        text-align: center;
    }

    nav ul li {
        margin: 20px 0;
    }

    nav ul li a {
        font-size: 1.5em;
    }

    .hamburger.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    .hamburger.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
}

.scroll-down {
    position: absolute;
    bottom: 20px;
    left: 50%;
    width: 20px;
    height: 20px;
    border-left: 2px solid #333;
    border-bottom: 2px solid #333;
    transform: translateX(-50%) rotate(-45deg);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0) rotate(-45deg);
    }
    40% {
        transform: translateX(-50%) translateY(-15px) rotate(-45deg);
    }
    60% {
        transform: translateX(-50%) translateY(-7px) rotate(-45deg);
    }
}

.profile-container {
    display: flex;
    align-items: center;
    gap: 100px;
    margin-top: 40px;
    width: 80%;
    max-width: 900px;
}

.profile-icon img {
    user-select: none;
    pointer-events: none;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.profile-details {
    flex: 1;
}

.profile-details h3 {
    font-size: 1.5em;
    margin: 0;
}

.profile-id {
    color: #777;
    margin-top: 5px;
}

.profile-details h4 {
    font-size: 1.3em;
    margin-top: 50px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.about-me {
    list-style: none;
    padding: 0;
    margin-top: 10px;
}

.about-me li {
    margin-bottom: 10px;
}

.about-me li span {
    font-weight: bold;
    margin-right: 10px;
    display: inline-block;
    width: 80px;
}

@media (max-width: 768px) {
    #profile h2 {
        font-size: 1.2em;
        margin-top: 90px;
    }

    .profile-id {
        font-size: 0.8em;
    }

    .profile-container {
        flex-direction: column;
        text-align: center;
        width: 90%;
        gap: 30px;
        margin-top: 30px;
    }

    .profile-icon img {
        width: 120px;
        height: 120px;
    }

    .profile-details h3 {
        font-size: 1.2em;
    }

    .profile-details h4 {
        font-size: 1.0em;
        margin-top: 30px;
        text-align: left;
    }

    .about-me {
        text-align: left;
    }

    .about-me li span {
        font-size: 0.9em;
    }

    .about-me li {
        font-size: 0.9em;
    }
}


.works-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin-top: 40px;
    overflow: hidden;
}

.works-list {
    display: flex;
    gap: 20px;
    will-change: transform; 
}

.work-item {
    flex: 0 0 auto;
    overflow: hidden;
    border-radius: 8px;
    display: block;
    text-decoration: none;
    cursor: pointer;
    position: relative;
}

.work-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

.work-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    /* background: linear-gradient(to top, rgba(37, 37, 37, 0.9), rgba(255, 255, 255, 0)); */
    background-color: #bbbbbbd7;
    color: #474747;
    padding: 20px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    border-radius: 8px;
}

.work-info h3 {
    margin: 1px;
    font-size: 0.9em;
}

.work-info p {
    margin: 0px;
    font-size: 0.8em;
    opacity: 0.9;
}

.work-item:hover .work-info {
    transform: translateY(0);
}

.work-item:hover img {
    filter: grayscale(0%);
}

@media (min-width: 769px) {
    .work-item {
        width: 400px;
        height: 300px;
    }
}

@media (max-width: 768px) {
    .work-item {
        width: 280px;
        height: 210px;
    }
    .work-info p {
        font-size: 0.85em;
    }

    #works h2 {
        font-size: 1.2em;
        margin-top: 90px;
    }
}

/* Timeline Styles */
#history {
    background-color: #fff;
}

.timeline {
    display: flex;
    flex-direction: column;
    gap: 40px;
    width: 100%;
    max-width: 500px;
    margin-top: 40px;
    position: relative;
    padding-left: 60px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: -40px;
    bottom: -40px;
    width: 2px;
    background-color: #ddd;
}

.timeline-item {
    position: relative;
    display: flex;
    gap: 25px;
    align-items: flex-start;
}

.timeline-marker {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: #474747;
    z-index: 1;
    position: absolute;
    left: -59px;
    top: 4px;
    box-shadow: 0 0 0 3px #fff, inset 0 0 0 2px #474747;
}

.timeline-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding-top: 0;
}

.timeline-date {
    font-weight: bold;
    font-size: 0.95em;
    color: #474747;
}

.timeline-company {
    font-size: 0.9em;
    color: #666;
}

.timeline-desc {
    font-size: 0.85em;
    color: #999;
}

@media (min-width: 769px) {
    .timeline-content {
        flex-direction: row;
        align-items: baseline;
        gap: 15px;
    }

    .timeline-date::after {
        content: '';
        margin-left: 10px;
        opacity: 0.3;
    }

    .timeline-company::after {
        content: '';
        margin-left: 10px;
        opacity: 0.3;
    }
}

@media (max-width: 768px) {
    .timeline {
        max-width: 40%;
    }

    .timeline::before {
        top: -65px;
        bottom: -20px;
    }

    .timeline-marker {
        font-size: 1.2em;
    }

    #history h2 {
        font-size: 1.2em;
        margin-top: 90px;
    }
}


#contact {
    background-color: #fff;
}

.email-display {
    font-family: 'Courier New', monospace;
    font-size: 1.3em;
    color: #474747;
    letter-spacing: 1px;
    margin-top: 40px;
    font-weight: bold;
}

.email-text {
    display: inline-block;
}

.cursor {
    display: inline-block;
    margin-left: 4px;
    animation: blink 0.7s infinite;
}

@keyframes blink {
    0%, 49% {
        opacity: 1;
    }
    50%, 100% {
        opacity: 0;
    }
}

@media (max-width: 768px) {
    .email-text {
        font-size: 1.2em;
    }  
    .email-display {
        font-size: 0.95em;
        letter-spacing: 0.5px;
    }

    #contact h2 {
        font-size: 1.2em;
        margin-top: 90px;
    }
}