:root {
    --bg-color: #ffffff;
    --text-color: #333333;
    --accent-color: #0056b3;
    --secondary-bg: #f9f9f9;
    --font-main: 'Noto Sans JP', sans-serif;
    --nav-height: 70px;
    --ease-out: cubic-bezier(0.25, 1, 0.5, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

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

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

ul {
    list-style: none;
}

/* Layout Utilities */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 100px 0;
}

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

.center-text {
    text-align: center;
}

/* Header */
#header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
}

.header-container {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    font-family: 'Outfit', sans-serif;
    /* Stylish Font */
    /* Brighter, Vibrant Gradient (Remove Dullness) */
    background: linear-gradient(45deg, #FF416C 0%, #FF4B2B 100%);
    /* Alternative: background: linear-gradient(to right, #ed213a 0%, #93291e 100%); */


    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    display: inline-block;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links li a {
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
}

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

.nav-links li a:hover::after,
.nav-links li a.active::after {
    width: 100%;
}

.nav-links li a.active {
    color: var(--accent-color);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--text-color);
    transition: 0.3s;
}

main {
    padding-top: var(--nav-height);
    flex: 1;
}

/* Hero Section Removed */


/* Section Titles */
.section-title {
    font-size: 2.5rem;
    display: block;
    width: fit-content;
    margin: 0 auto 60px;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--accent-color);
    margin: 15px auto 0;
}

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

.about-image img {
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s var(--ease-out);
}

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

.timeline {
    margin-top: 30px;
    border-left: 2px solid #eee;
    padding-left: 20px;
}

.timeline-item {
    margin-bottom: 30px;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -26px;
    top: 5px;
    width: 10px;
    height: 10px;
    background: var(--accent-color);
    border-radius: 50%;
}

.timeline-logo-header {
    height: 30px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
}

.brand-logo-lifull {
    height: 100%;
    width: auto;
}

.timeline-item h4 {
    margin: 5px 0;
    font-size: 1.1rem;
}

.date {
    font-size: 0.85rem;
    color: #555;
    /* Darker than #888 for better visibility */
}

/* Works Section */
.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.work-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.work-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.work-image {
    height: 200px;
    background-size: cover;
    background-position: center;
    background-color: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    font-weight: 500;
}

/* New: Container for Logo-based work items */
.work-icon-container {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.work-svg-logo {
    width: 80px;
    height: 80px;
}

.app-icon {
    width: auto;
    height: 150px;
    /* Larger than simple logos */
    max-width: 90%;
    object-fit: contain;
}

.work-info {
    padding: 20px;
    flex-grow: 1;
    /* Ensure uniform height */
}

.work-info h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.work-info p {
    font-size: 0.9rem;
    color: #666;
}

.closed {
    opacity: 0.7;
}

.placeholder-image {
    background: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}

/* Skills Section */
.skills-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
}

.skill-category h3 {
    margin-bottom: 20px;
    font-size: 1.2rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

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

.skill-tag {
    background: #f0f4f8;
    color: #333;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.skill-tag:hover {
    background: #e1e8ed;
}

/* Hobby Section */
.hobby-content {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.hobby-text h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.interest-list {
    list-style: none;
    margin-bottom: 30px;
}

.interest-list li {
    margin-bottom: 12px;
    font-size: 1rem;
    line-height: 1.6;
    padding-left: 15px;
    position: relative;
}

.interest-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-color);
}

.interest-label {
    font-weight: 700;
    color: #444;
}

.minor-title {
    font-size: 1.2rem;
    margin: 40px 0 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* Collapsible Gallery (Desktop & Mobile) */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    max-height: 800px;
    /* Show approx 3 rows */
    overflow: hidden;
    position: relative;
    transition: max-height 0.8s ease;
    padding-bottom: 20px;
}

.photo-gallery.expanded {
    max-height: 20000px;
    /* Large enough to show all */
}

/* Gradient Overlay */
.photo-gallery::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 150px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
    display: block;
    pointer-events: none;
    transition: opacity 0.5s;
}

.photo-gallery.expanded::after {
    opacity: 0;
    pointer-events: none;
}

.photo-gallery img {
    width: 100%;
    height: 250px;
    /* Enforce uniform height */
    object-fit: cover;
    /* Crop to fill the square/rectangle */
    margin-bottom: 0;
    /* Grid handles gap */
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s var(--ease-out);
    display: block;
    cursor: pointer;
}

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

.gallery-toggle {
    display: block;
    margin: 20px auto 0;
    cursor: pointer;
    z-index: 10;
    position: relative;
}

@media (max-width: 768px) {
    .photo-gallery {
        grid-template-columns: repeat(2, 1fr);
        /* 2 columns on mobile */
    }
}

@media (max-width: 480px) {
    .photo-gallery {
        grid-template-columns: 1fr;
        /* 1 column on small screens */
    }
}

/* Replaces old insta-feed */
.insta-feed {
    display: none;
}

/* Contact Section */
.btn {
    display: inline-block;
    background: var(--text-color);
    color: #fff;
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: 500;
    margin: 30px 0;
    transition: background 0.3s;
}

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

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.sns-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f0f0f0;
    transition: transform 0.2s, background 0.2s, fill 0.2s;
}

.sns-icon svg {
    width: 20px;
    height: 20px;
    fill: #333;
    transition: fill 0.2s;
}

.sns-icon:hover {
    transform: translateY(-3px);
}

/* SNS Hover Colors */
.sns-icon:hover svg {
    fill: #fff;
}

.x-icon:hover {
    background: #000;
}

.github-icon:hover {
    background: #333;
}

.facebook-icon:hover {
    background: #1877F2;
}

.linkedin-icon:hover {
    background: #0A66C2;
}

.instagram-icon:hover {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

/* Footer */
#footer {
    background: #f0f0f0;
    padding: 40px 0;
    text-align: center;
    color: #888;
    font-size: 0.9rem;
}

/* Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(50px);
    /* Increased distance */
    transition: opacity 1s var(--ease-out), transform 1s var(--ease-out);
    /* Slower duration */
}

/* Emphasized Name in About Section */
.about-name {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
    letter-spacing: 0.05em;
    line-height: 1.2;
    font-family: 'Outfit', sans-serif;
    /* Stylish Font */
    /* Matching Vibrant Gradient */
    background: linear-gradient(45deg, #FF416C 0%, #FF4B2B 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    display: inline-block;
}

.nickname {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 15px;
    font-weight: 400;
}

.birth-date {
    margin-top: 20px;
}

@media (max-width: 768px) {
    .about-name {
        font-size: 1.8rem;
    }
}

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

/* Mobile Responsiveness & Fixes */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
        z-index: 1001;
    }

    /* Fixed Navigation for Mobile */
    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 80%;
        /* Slightly wider for better tap area */
        max-width: 300px;
        background: #fff;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transform: translateX(100%);
        transition: transform 0.3s var(--ease-out);
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        padding-top: 60px;
    }

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

    /* Prevent Horizontal Overflow */
    html,
    body {
        overflow-x: hidden;
        width: 100%;
    }

    .container {
        padding: 0 20px;
        width: 100%;
    }

    /* Mobile Profile Image: Circular and centered */
    .about-image {
        margin: 0 auto 30px;
        width: 200px;
        height: 200px;
    }

    .about-image img {
        border-radius: 50%;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .about-text {
        text-align: center;
    }

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

    /* Grid Adjustments */
    .about-grid,
    .works-grid,
    .skills-wrapper,
    .hobby-grid,
    .insta-feed {
        grid-template-columns: 1fr;
    }

    /* Hero Text Sizing */
    .hero-title {
        font-size: 2.5rem;
        word-break: break-word;
    }

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

    .timeline-logo-header {
        height: 30px;
    }
}

/* Resume Section Styles */
.highlight-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-color);
    margin-top: 5px;
}

.highlight-role {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 10px;
}

.resume-section {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.resume-section h4 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    margin-top: 30px;
    color: #444;
}

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

.resume-list li {
    margin-bottom: 10px;
    padding-left: 20px;
    position: relative;
    font-size: 0.95rem;
}

.resume-list li::before {
    content: '•';
    color: var(--accent-color);
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* Timeline Brand Logo Fix */
.timeline-logo-header {
    height: 40px;
    margin-bottom: 10px;
    margin-top: 15px;
    /* Added spacing above logo */
    display: flex;
    align-items: center;
}

.brand-logo-lifull {
    height: 100%;
    width: auto;
    object-fit: contain;
}

/* External Link Styles */
.external-link {
    font-size: 0.9rem;
    color: var(--accent-color);
    text-decoration: underline;
    opacity: 0.8;
    word-break: break-all;
}

.external-link:hover {
    opacity: 1;
}

/* Gallery Toggle (Mobile Only) - Moved here for specificity */


@media (max-width: 768px) {
    .gallery-toggle {
        display: block;
        margin: 20px auto 0;
    }
}

/* Lightbox Styles */
#lightbox {
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow: hidden;
    /* Ensure no scrollbars */
}

#lightbox.active {
    display: flex;
    opacity: 1;
}

/* Lightbox Carousel Track */
.lightbox-track {
    display: flex;
    align-items: center;
    height: 100%;
    width: max-content;
    /* Allow dynamic sizing based on children */
    will-change: transform;
}

.lightbox-track.animating {
    transition: transform 0.3s ease-out;
}

.lightbox-image-container {
    width: 85vw;
    /* Mobile: 85vw to show peek of neighbors */
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    /* Minimal gap */
    box-sizing: border-box;
    flex-shrink: 0;
    /* Prevent shrinking! */
}

/* PC: Full width */
@media (min-width: 769px) {
    .lightbox-image-container {
        width: 100vw;
        padding: 0;
    }
}

.lightbox-image-container img {
    max-width: 100%;
    max-height: 90%;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
    object-fit: contain;
    user-select: none;
}

/* Lightbox Navigation */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    font-size: 2rem;
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.3s;
    border-radius: 5px;
    user-select: none;
    z-index: 10001;
    /* Ensure above image */
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox-nav.hidden-nav {
    display: none;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

@media (max-width: 768px) {
    .lightbox-nav {
        display: none !important;
        /* Hide buttons on mobile, use swipe */
    }

    .swipe-hint {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        font-size: 3rem;
        color: rgba(255, 255, 255, 0.7);
        pointer-events: none;
        opacity: 0;
        transition: opacity 1s ease-out;
        z-index: 10000;
        text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    }

    .swipe-hint.visible {
        opacity: 1;
    }

    .swipe-hint-left {
        left: 20px;
    }

    .swipe-hint-right {
        right: 20px;
    }
}

/* Lightbox Controls (Close) */
.lightbox-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 15px;
    z-index: 10002;
}

.lightbox-control {
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 0.3s, transform 0.2s;
    backdrop-filter: blur(5px);
}

.lightbox-control:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.lightbox-control:active {
    transform: scale(0.95);
}

.lightbox-control svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* Awards & Speaking Refinement */
.awards-custom-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.award-card {
    background: #fff;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border-left: 5px solid var(--accent-color);
    /* Accent border */
    transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
    display: flex;
    flex-direction: column;
}

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

.award-year {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 10px;
    font-weight: 500;
}

.award-content h3 {
    margin: 0 0 10px;
    font-size: 1.1rem;
    color: #333;
}

.award-content p {
    font-size: 0.95rem;
    color: #555;
    margin: 0;
}

/* Speaking Section */
.speaking-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.speaking-organizer {
    font-size: 0.8rem;
    color: #888;
    margin-left: 8px;
    font-weight: 500;
}

.speaking-card {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.3s var(--ease-out);
    border-top: 4px solid #333;
    /* Distinct from awards */
}

.speaking-card:hover {
    transform: translateY(-5px);
}

.speaking-header {
    margin-bottom: 15px;
}

.speaking-date {
    background: #eee;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #555;
    display: inline-block;
    margin-bottom: 10px;
}

.speaking-title {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.4;
}

.speaking-body p {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 20px;
}

.speaking-link {
    display: inline-block;
    padding: 8px 16px;
    background: #333;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: background 0.2s;
    text-align: center;
    width: fit-content;
}

.speaking-link:hover {
    background: #555;
    color: #fff;
}

.speaking-links {
    display: flex;
    gap: 10px;
}

.speaking-link.secondary {
    background: transparent;
    color: #333;
    border: 1px solid #ccc;
}

.speaking-link.secondary:hover {
    background: #f5f5f5;
    color: #333;
}