/* Global Styles */
:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --text-color: #1f2937;
    --background-color: #ffffff;
    --section-bg: #f3f4f6;
    --dark-blue: #0a192f;
    --dark-blue-secondary: #112240;
    --dark-blue-lighter: #233554;
    --dark-black: #000000;
    --dark-gray: #0d1421;
    --accent-blue: #64ffda;
    --accent-blue-dark: #2188ff;
    --text-light: #ffffff;
    --text-light-blue: #8892b0;
    --glow-shadow: 0 0 30px rgba(100, 255, 218, 0.3);
    --glow-shadow-intense: 0 0 50px rgba(100, 255, 218, 0.5);
    --border-radius-sm: 8px;
    --border-radius-md: 16px;
    --border-radius-lg: 20px;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 10px 20px rgba(0, 0, 0, 0.15), 0 3px 6px rgba(0, 0, 0, 0.1);
    --button-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --button-shadow-hover: 0 4px 8px rgba(0, 0, 0, 0.15);
    --focus-ring: 0 0 0 3px rgba(100, 255, 218, 0.3);
    --focus-shadow: var(--card-shadow-hover), var(--glow-shadow);
    --card-transition: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    --layer-transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --gradient-1: rgba(100, 255, 218, 0.15);
    --gradient-2: rgba(33, 136, 255, 0.12);
    --gradient-3: rgba(147, 197, 253, 0.1);
    --gradient-blur: 120px;
    --animation-timing: 2s;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: linear-gradient(135deg,
            var(--dark-black) 0%,
            var(--dark-gray) 25%,
            var(--dark-blue) 50%,
            var(--dark-blue-secondary) 75%,
            var(--dark-blue) 100%);
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-size: cover;
    position: relative;
    min-height: 100vh;
}

/* Mobile background fix */
@media (max-width: 768px) {
    body {
        background-attachment: scroll;
        background-size: 100% 100%;
        background-repeat: no-repeat;
    }

    /* Add fallback background for very small screens */
    body::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(135deg,
                var(--dark-black) 0%,
                var(--dark-gray) 25%,
                var(--dark-blue) 50%,
                var(--dark-blue-secondary) 75%,
                var(--dark-blue) 100%);
        z-index: -10;
        pointer-events: none;
    }
}

/* Additional background pattern overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 50%, rgba(100, 255, 218, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(33, 136, 255, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(147, 197, 253, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* モバイル用の背景パターン調整 */
@media (max-width: 768px) {
    body::before {
        position: absolute;
        background:
            radial-gradient(circle at 20% 30%, rgba(100, 255, 218, 0.05) 0%, transparent 40%),
            radial-gradient(circle at 80% 70%, rgba(33, 136, 255, 0.05) 0%, transparent 40%);
    }
}

/* Header Styles */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(10, 25, 47, 0.85);
    backdrop-filter: blur(10px);
    z-index: 1000;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-blue);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

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

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

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: transparent;
    color: var(--text-light);
    position: relative;
    /* 背景画像を使用する場合のコメントアウト例 */
    /* 
    background-image: url('images/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    */
}

.hero-content {
    padding: 2rem;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--accent-blue);
}

.hero p {
    color: var(--text-light-blue);
}

.cta-button {
    display: inline-block;
    padding: 1rem 2rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 0.5rem;
    margin-top: 2rem;
    transition: background-color 0.3s ease;
}

.cta-button:hover {
    background-color: var(--secondary-color);
}

/* Section Styles */
section {
    position: relative;
    z-index: 2;
    background-color: rgba(10, 25, 47, 0.1);
    backdrop-filter: blur(5px);
    padding: 5rem 2rem;
}

section:nth-child(even) {
    background-color: rgba(17, 34, 64, 0.1);
}

.about,
.projects,
.contact {
    max-width: 1200px;
    margin: 0 auto;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

/* About Section */
.about {
    background-color: transparent !important;
    color: var(--text-light);
}

.about h2 {
    color: var(--accent-blue);
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
    text-transform: none;
    letter-spacing: normal;
    -webkit-text-stroke: none;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.about-text {
    color: var(--text-light-blue);
}

.about-text p {
    color: var(--text-light-blue);
    margin-bottom: 1rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.skill-tags span {
    padding: 0.5rem 1rem;
    background-color: var(--dark-blue-secondary);
    color: var(--accent-blue);
    border-radius: 2rem;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--accent-blue);
}

.skill-tags span:hover {
    background-color: rgba(100, 255, 218, 0.1);
}

/* Projects Section */
.projects {
    background-color: rgba(10, 25, 47, 0.3);
    color: var(--text-light);
    padding: 6rem 2rem;
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius-lg);
    margin: 2rem auto;
    max-width: 1200px;
    box-shadow: var(--card-shadow);
}

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

/* プロジェクトセクションのコンテナスタイル */
.projects::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--dark-blue-secondary) 0%, var(--dark-blue) 100%);
    opacity: 0.3;
    z-index: 1;
    border-radius: var(--border-radius-lg);
}

.projects .project-grid,
.projects h2 {
    position: relative;
    z-index: 2;
}

.project-card {
    background-color: var(--dark-blue-secondary);
    padding: 0;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--card-shadow);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--dark-blue-lighter);
    transform-style: preserve-3d;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.project-image {
    width: 100%;
    height: 160px;
    overflow: hidden;
    position: relative;
    margin: 0.75rem;
    margin-bottom: 0;
    border-radius: var(--border-radius-lg);
    width: calc(100% - 1.5rem);
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    border-radius: var(--border-radius-lg);
}

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

.project-content {
    padding: 1rem 1.5rem 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.project-card h3 {
    color: var(--text-light);
    font-size: 1.5rem;
    margin-bottom: 0;
    transition: transform var(--layer-transition), color var(--layer-transition);
}

.project-card p {
    color: var(--text-light-blue);
    transition: transform var(--layer-transition), opacity var(--layer-transition);
    margin-bottom: 0;
    flex: 1;
}

.project-card .project-link {
    color: var(--accent-blue);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    transition: transform var(--layer-transition), opacity var(--layer-transition);
    margin-top: auto;
}

/* Image placeholder for missing images */
.project-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--dark-blue-lighter) 0%, var(--dark-blue-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: -1;
}

.project-image::after {
    content: '🖼️';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    opacity: 0.3;
    z-index: 0;
}

.project-image img {
    position: relative;
    z-index: 1;
}

/* Error handling for broken images */
.project-image img[src=""],
.project-image img:not([src]) {
    display: none;
}

/* Contact Section */
.contact-content {
    max-width: 600px;
    margin: 0 auto;
}

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

.social-links a {
    color: var(--accent-blue);
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.social-links a:hover {
    color: var(--text-light);
    transform: translateY(-3px);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-form input,
.contact-form textarea {
    padding: 1rem;
    border: 1px solid var(--dark-blue-lighter);
    border-radius: 0.5rem;
    font-size: 1rem;
    background-color: var(--dark-blue-secondary);
    color: var(--text-light);
}

.contact-form textarea {
    min-height: 150px;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: var(--text-light-blue);
}

.submit-button {
    padding: 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.submit-button:hover {
    background-color: var(--secondary-color);
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    background-color: var(--dark-blue-secondary);
    color: var(--text-light-blue);
    border-top: 1px solid var(--dark-blue-lighter);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

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

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

    section {
        padding: 3rem 1rem;
    }

    .profile-image {
        margin: 0 auto 2rem;
    }

    .projects {
        margin: 1rem;
        max-width: calc(100% - 2rem);
        padding: 4rem 1.5rem;
    }
}

/* Dark Blue Sections */
.dark-blue-section,
.projects,
.contact {
    background-color: rgba(10, 25, 47, 0.3);
    color: var(--text-light);
    padding: 6rem 2rem;
    position: relative;
    overflow: hidden;
}

.dark-blue-section::before,
.projects::before,
.contact::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--dark-blue-secondary) 0%, var(--dark-blue) 100%);
    opacity: 0.7;
    z-index: 1;
}

.dark-blue-section .container,
.projects .project-grid,
.contact .contact-content {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
}

.dark-blue-section h2,
.projects h2,
.contact h2 {
    color: var(--accent-blue);
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.dark-blue-section p,
.projects p,
.contact p {
    color: var(--text-light-blue);
    font-size: 1.2rem;
    line-height: 1.8;
    margin-bottom: 2rem;
}

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

.feature-card {
    background-color: var(--dark-blue-secondary);
    padding: 2rem;
    border-radius: 1rem;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--dark-blue-lighter);
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--primary-color) 100%);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 0;
    border-radius: 1rem;
}

.feature-card:hover,
.feature-card:focus-within {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--glow-shadow);
}

.feature-card:hover::before,
.feature-card:focus-within::before {
    opacity: 0.1;
}

.feature-card>* {
    position: relative;
    z-index: 1;
}

.feature-card:focus-within {
    outline: none;
    box-shadow: var(--glow-shadow-intense);
}

.feature-card h3 {
    color: var(--accent-blue);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.feature-card p {
    color: var(--text-light-blue);
    text-align: left;
}

.glow-button {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--dark-blue-secondary);
    color: var(--accent-blue);
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
    margin-top: 2rem;
    border: 1px solid var(--accent-blue);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: none;
}

.glow-button::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--primary-color) 100%);
    z-index: -1;
    border-radius: 0.6rem;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.glow-button:hover,
.glow-button:focus {
    background: rgba(100, 255, 218, 0.1);
    box-shadow: var(--glow-shadow);
}

.glow-button:hover::before,
.glow-button:focus::before {
    opacity: 1;
}

.glow-button:active {
    transform: translateY(0) scale(0.98);
}

.glow-button:focus {
    box-shadow: var(--glow-shadow-intense);
}

/* Add focus styles for interactive elements */
.feature-card a:focus,
.nav-links a:focus,
.social-links a:focus {
    outline: none;
    box-shadow: var(--glow-shadow);
    border-radius: 0.3rem;
}

/* Smooth transition for all interactive elements */
a,
button,
input,
textarea {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Add focus styles for form elements */
.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    box-shadow: var(--glow-shadow);
    border-color: var(--accent-blue);
}

/* Add hover and focus effects for project cards */
.project-card {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover,
.project-card:focus-within {
    transform: translateY(-10px);
    box-shadow: var(--glow-shadow);
}

.project-card:focus-within {
    outline: none;
    box-shadow: var(--glow-shadow-intense);
}

/* Add animation for skill tags */
.skill-tags span:hover {
    transform: translateY(-3px);
    box-shadow: var(--glow-shadow);
}

/* プロフィール画像用のスタイル */
.profile-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 1.5rem;
    border: 2px solid var(--accent-blue);
    box-shadow: var(--card-shadow);
    background: transparent;
}

.profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* About セクション用の画像スタイル */
.about-image {
    width: 100%;
    max-width: 250px;
    height: 250px;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--border-radius-lg);
}

/* 一般的な画像の角丸スタイル */
img {
    border-radius: var(--border-radius-sm);
}

/* 特定の画像コンテナの角丸 */
.image-container {
    border-radius: var(--border-radius-md);
    overflow: hidden;
}

.image-container img {
    border-radius: var(--border-radius-md);
}

/* Skills section styling */
.skills {
    color: var(--text-light);
}

.skills h3 {
    color: var(--accent-blue);
    margin-bottom: 1rem;
}

/* Twitter to X icon conversion */
.fab.fa-twitter:before,
.fa-twitter:before {
    content: '𝕏' !important;
    font-family: system-ui, -apple-system, sans-serif !important;
    font-weight: bold !important;
    font-style: normal !important;
}

/* モバイル用セクション調整 */
@media (max-width: 768px) {
    section {
        background-color: rgba(10, 25, 47, 0.2);
        backdrop-filter: none;
    }

    section:nth-child(even) {
        background-color: rgba(17, 34, 64, 0.2);
    }
}