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

:root {
    --bg-dark: #0d0d0d;
    --bg-card: #1a1a1a;
    --accent-primary: #52b86a;
    --accent-secondary: #2e7d46;
    --text-primary: #ffffff;
    --text-secondary: #b8b8b8;
    --border-color: #2d2d2d;
    color-scheme: dark;
}

[data-theme="light"],
[data-theme="light"] * {
    --bg-dark: #fafafa !important;
    --bg-card: #ffffff !important;
    --text-primary: #1a1a1a !important;
    --text-secondary: #6b7280 !important;
    --border-color: #e5e7eb !important;
    color-scheme: light;
}

html {
    scroll-behavior: auto;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.lang-ja {
    font-family: 'Noto Sans JP', 'Inter', sans-serif;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent-primary);
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    z-index: 10000;
    border-radius: 0 0 8px 0;
}

.skip-link:focus {
    top: 0;
}

*:focus-visible {
    outline: 3px solid var(--accent-primary);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
    outline: 3px solid var(--accent-primary);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    z-index: 9999;
    transform: scaleX(0);
    transform-origin: left center;
    transition: none;
    will-change: transform;
}

.header {
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color 0.3s ease;
}

[data-theme="light"] .header {
    background: rgba(250, 250, 250, 0.95) !important;
}

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

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

.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

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

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
    color: var(--accent-primary);
}

.controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.theme-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    color: var(--text-primary);
}

.moon-icon {
    display: none;
}

.language-switcher {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    min-width: 44px;
    min-height: 44px;
}

.lang-btn:hover,
.lang-btn:focus-visible {
    color: var(--accent-primary);
    background: rgba(82, 184, 106, 0.1);
}

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

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

.hero-section {
    text-align: center;
    padding: 4rem 2rem 2rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
    will-change: transform, opacity;
}

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

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
}

.stats-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 3rem 0;
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.2s forwards;
    will-change: transform, opacity;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover,
.stat-card:focus-within {
    transform: translateY(-5px);
    border-color: var(--accent-primary);
    box-shadow: 0 10px 30px rgba(82, 184, 106, 0.2);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.profile-section {
    display: flex;
    gap: 3rem;
    margin-top: 3rem;
    align-items: flex-start;
}

.sidebar {
    flex: 0 0 280px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    position: sticky;
    top: 100px;
    opacity: 0;
    animation: slideInLeft 0.8s ease 0.3s forwards;
    will-change: transform, opacity;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.profile-img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 3px solid var(--accent-primary);
    margin-bottom: 1.5rem;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.profile-img:hover {
    transform: scale(1.05) rotate(5deg);
}

.profile-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.profile-info {
    text-align: left;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.profile-info-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.profile-info-item svg {
    color: var(--accent-primary);
    flex-shrink: 0;
    min-width: 16px;
}

.profile-info-item a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.profile-info-item a:hover,
.profile-info-item a:focus-visible {
    color: var(--accent-secondary);
}

.tech-stack {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.tech-stack h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-tag {
    background: rgba(82, 184, 106, 0.1);
    border: 1px solid rgba(82, 184, 106, 0.3);
    color: var(--accent-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tech-tag:hover,
.tech-tag:focus-visible {
    background: var(--accent-primary);
    color: white;
    transform: translateY(-2px);
}

.main-content {
    flex: 1;
    min-width: 0;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.project-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.search-box,
.filter-select {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    min-height: 44px;
}

.search-box {
    flex: 1;
    min-width: 250px;
}

.search-box:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(82, 184, 106, 0.1);
}

.filter-select {
    cursor: pointer;
}

.loader-container {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
}

.loader-text {
    color: var(--text-secondary);
}

.loader {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.skeleton {
    background: linear-gradient(90deg, var(--border-color) 25%, rgba(82, 184, 106, 0.1) 50%, var(--border-color) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.42s ease, border-color 0.26s ease, box-shadow 0.26s ease;
    transition-delay: var(--reveal-delay, 0ms), var(--reveal-delay, 0ms), 0ms, 0ms;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translate3d(0, 24px, 0);
    will-change: transform, opacity;
    backface-visibility: hidden;
    transform-style: preserve-3d;
}

.project-card.scrolled {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.project-card:hover,
.project-card:focus-within {
    transform: translate3d(0, -8px, 0);
    border-color: var(--accent-primary);
    box-shadow: 0 20px 40px rgba(82, 184, 106, 0.2);
    transition-delay: 0ms;
}

.project-card:hover::before {
    transform: scaleX(1);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.project-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.project-repo {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-family: 'Courier New', monospace;
    word-break: break-all;
}

.view-btn {
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-btn:hover,
.view-btn:focus-visible {
    background: var(--accent-secondary);
    transform: scale(1.05);
}

.project-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.project-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.meta-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.language-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: rgba(82, 184, 106, 0.1);
    border: 1px solid rgba(82, 184, 106, 0.3);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--accent-primary);
}

.language-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.last-update {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.last-update svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state svg {
    margin: 0 auto 2rem;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--accent-primary);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    z-index: 999;
    border: none;
    min-width: 50px;
    min-height: 50px;
    will-change: transform, opacity;
    backface-visibility: hidden;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover,
.back-to-top:focus-visible {
    background: var(--accent-secondary);
    transform: translateY(-5px);
}

.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 3rem 2rem;
    margin-top: 4rem;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

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

.footer-links a:hover,
.footer-links a:focus-visible {
    color: var(--accent-primary);
}

.footer-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.certifications-section {
    margin: 4rem 0;
    padding: 2rem 0;
}

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

.cert-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.42s ease, border-color 0.26s ease, box-shadow 0.26s ease;
    transition-delay: var(--reveal-delay, 0ms), var(--reveal-delay, 0ms), 0ms, 0ms;
    opacity: 0;
    transform: translate3d(0, 24px, 0);
    will-change: transform, opacity;
    backface-visibility: hidden;
}

.cert-card.scrolled {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.cert-card:hover {
    transform: translate3d(0, -5px, 0);
    border-color: var(--accent-primary);
    box-shadow: 0 10px 30px rgba(82, 184, 106, 0.1);
    transition-delay: 0ms;
}

.cert-card h3 {
    color: var(--accent-primary);
    margin-top: 0;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.cert-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cert-card li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    padding-left: 1.5rem;
    position: relative;
}

.cert-card li:before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: var(--accent-primary);
    border-radius: 50%;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.5rem;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(82, 184, 106, 0.05);
}

.submit-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(82, 184, 106, 0.3);
}

.submit-btn:active {
    transform: translateY(0);
}

.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-primary);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10000;
    max-width: 90%;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.error {
    border-left-color: #ef4444;
}

@media (max-width: 1024px) {
    .header nav {
        padding: 0 1.25rem;
    }

    .container {
        padding: 2.5rem 1.25rem;
    }

    .profile-section {
        flex-direction: column;
    }

    .sidebar {
        position: relative;
        top: 0;
        width: 100%;
    }

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

    .stats-dashboard {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stat-card {
        padding: 1.5rem;
    }

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

@media (max-width: 900px) {
    .header nav {
        position: relative;
        gap: 0.75rem;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .nav-links {
        position: absolute;
        top: calc(100% + 0.5rem);
        left: 1rem;
        right: 1rem;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: 12px;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        max-height: 0;
        overflow: hidden;
        padding: 0;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
        transition: max-height 0.28s ease, padding 0.28s ease;
        z-index: 120;
    }

    .nav-links {
        gap: 0;
    }

    .nav-links a {
        padding: 0.95rem 1rem;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-links a:last-child {
        border-bottom: none;
    }

    .nav-links.active {
        max-height: 540px;
        padding: 0.5rem 0;
    }

    .controls {
        margin-left: auto;
    }

    .language-switcher {
        padding: 0.35rem;
    }

    .lang-btn {
        padding: 0.3rem 0.65rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 2rem 1rem;
    }

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

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

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

    .stats-dashboard {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-value {
        font-size: 2rem;
    }

    .project-controls {
        flex-direction: column;
        gap: 0.75rem;
    }

    .search-box,
    .filter-select {
        width: 100%;
        min-width: 0;
    }

    .projects-grid {
        gap: 1.25rem;
    }

    .project-card,
    .cert-card {
        padding: 1.4rem;
    }

    .footer {
        padding: 2.25rem 1rem;
    }
}

@media (max-width: 480px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }

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

    .stats-dashboard {
        grid-template-columns: 1fr;
    }

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

    .footer-links {
        gap: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .scroll-progress {
        transition: none !important;
    }

    .project-card,
    .cert-card {
        transition-delay: 0ms !important;
    }
}


