
:root {
    --primary: #005304;
    --secondary: #002A93;
    --accent: #FFD298;
    --dark: #000000;
    --light: #ffffff;
    --bg-light: #f7f7f7;
    --text-dark: #333333;
    
    /* Modern additions */
    --gradient-primary: linear-gradient(135deg, #005304 0%, #007a06 100%);
    --gradient-secondary: linear-gradient(135deg, #002A93 0%, #003BC1 100%);
    --gradient-hero: linear-gradient(135deg, #005304 0%, #003A25 50%, #002A93 100%);
    --shadow-soft: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.15);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Resume preview variables */
    --primary-color: #005304;
    --secondary-color: #002A93;
    --accent-color: #FFD298;
    --text-primary: #333333;
    --text-secondary: #666666;
    --primary-rgb: 0, 83, 4;
}
body {
    margin: 0;
    padding: 0;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    box-sizing: border-box;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

/* パフォーマンス最適化 */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* HTML5 semantic elements reset */
main {
    display: block;
}

article {
    display: block;
}
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--gradient-hero);
    color: var(--light);
    text-align: center;
    padding: 2rem 1rem;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

/* Hero background overlay effect */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 20%, rgba(255, 210, 152, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(0, 42, 147, 0.15) 0%, transparent 50%);
    pointer-events: none;
}
.hero img {
    max-width: 150px;
    height: auto;
    margin-bottom: 1rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
    position: relative;
    z-index: 1;
    transition: var(--transition);
}

.logo-text {
    font-size: 6rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
    transition: var(--transition);
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

.hero img:hover, .logo-text:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-hover);
}
.hero h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: bold;
    position: relative;
    z-index: 1;
    color: var(--light);
}
.hero-tagline {
    margin: 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.hero-description {
    margin: 1rem 0;
    font-size: 0.95rem;
    opacity: 0.9;
    line-height: 1.5;
}
.hero-cta {
    margin-top: 1.5rem;
}
.btn-hero {
    background: linear-gradient(135deg, var(--accent-color) 0%, #ffb347 100%);
    color: var(--primary-color);
    font-weight: bold;
    padding: 1rem 2rem;
    border-radius: 50px;
    box-shadow: 0 8px 25px rgba(255, 179, 71, 0.4);
    transition: var(--transition);
    will-change: transform, box-shadow;
    position: relative;
    z-index: 1;
    border: 2px solid transparent;
    overflow: hidden;
}

.btn-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.6s;
}

.btn-hero:hover::before {
    left: 100%;
}

.btn-hero:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(255, 179, 71, 0.6);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-hero:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255, 179, 71, 0.5);
    background: linear-gradient(135deg, #ffb347 0%, var(--accent-color) 100%);
}
.section {
    padding: 2rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}
.section h2 {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}
.projects {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}
.project {
    flex: 1 1 300px;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
    background: linear-gradient(145deg, var(--light) 0%, #fafafa 100%);
    opacity: 0;
    transform: translateY(20px);
    width: 100%;
    box-sizing: border-box;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.project::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    transition: var(--transition);
}

.project:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.project.ai::before {
    background: var(--gradient-secondary);
}
.project.ent::before {
    background: var(--gradient-primary);
}
.project.edu::before {
    background: linear-gradient(135deg, var(--accent) 0%, #FFE8B8 100%);
}

.project h3 {
    margin-top: 0;
    color: var(--secondary);
    font-size: 1.2rem;
    position: relative;
    z-index: 1;
}
.project p {
    margin: 0.5rem 0;
    position: relative;
    z-index: 1;
}
.project a {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
    position: relative;
    z-index: 1;
}

.project.ent::before {
    background: var(--gradient-primary);
}

.project.edu::before {
    background: linear-gradient(135deg, var(--accent) 0%, #FFE8B8 100%);
}

/* Enhanced project hover effects with background images */
.project:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}
.download {
    margin-top: 1.5rem;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
}

.download a {
    display: inline-block;
    padding: 1rem 1.5rem;
    background: var(--gradient-secondary);
    color: var(--light);
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: bold;
    min-height: 44px;
    min-width: 44px;
    font-size: 1rem;
    text-align: center;
    box-sizing: border-box;
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.download a::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.download a:hover::before {
    width: 300px;
    height: 300px;
}

.download a:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}
footer {
    background-color: var(--primary);
    color: var(--light);
    text-align: center;
    padding: 1rem;
    font-size: 0.9rem;
    width: 100%;
    box-sizing: border-box;
}
.contact-section {
    opacity: 0;
    transform: translateY(20px);
    text-align: center;
}
.contact-intro {
    font-size: 1.05rem;
    color: var(--text-dark);
    margin-bottom: 2rem;
    opacity: 0.8;
}
.contact-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
    align-items: center;
}

/* 統一されたボタンシステム */
.btn {
    display: inline-block;
    text-decoration: none;
    border: none;
    border-radius: 50px;
    padding: 1rem 2rem;
    font-weight: bold;
    cursor: pointer;
    min-height: 44px;
    min-width: 44px;
    font-size: 1rem;
    text-align: center;
    box-sizing: border-box;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    will-change: transform, box-shadow;
    /* モバイル用のタッチ最適化 */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease, background 0.4s ease;
}

/* モバイル環境でのタッチ時のみリセット */
@media (hover: none) and (pointer: coarse) {
    .btn::after {
        transition: width 0.2s ease, height 0.2s ease, background 0.2s ease;
    }
    
    .btn:active::after {
        transition: width 0.1s ease, height 0.1s ease, background 0.1s ease;
    }
}

/* オレンジ系ボタン（ヒーローボタン） */
.btn-hero {
    background: linear-gradient(135deg, var(--accent-color) 0%, #ffb347 100%);
    color: var(--primary-color);
    box-shadow: 0 8px 25px rgba(255, 179, 71, 0.4);
}

.btn-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.6s;
}

/* PC環境でのホバーエフェクトのみ */
@media (hover: hover) and (pointer: fine) {
    .btn-hero:hover {
        transform: translateY(-3px);
        box-shadow: 0 12px 35px rgba(255, 179, 71, 0.6);
    }

    .btn-hero:hover::before {
        left: 100%;
    }

    .btn-hero:hover::after {
        width: 200px;
        height: 200px;
        background: rgba(255, 255, 255, 0.2);
    }
}

.btn-hero:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255, 179, 71, 0.5);
    background: linear-gradient(135deg, #ffb347 0%, var(--accent-color) 100%);
}

.btn-hero:active::after {
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.3);
    transition: width 0.2s ease, height 0.2s ease, background 0.2s ease;
}

/* 青系ボタン（プライマリボタン） */
.btn-primary {
    background: linear-gradient(135deg, var(--secondary) 0%, #003BC1 100%);
    color: var(--light);
    box-shadow: 0 4px 16px rgba(0, 42, 147, 0.3);
}

/* PC環境でのホバーエフェクトのみ */
@media (hover: hover) and (pointer: fine) {
    .btn-primary:hover {
        background: linear-gradient(135deg, #003BC1 0%, #0048D4 100%);
        box-shadow: 0 6px 20px rgba(0, 42, 147, 0.4);
        transform: translateY(-2px);
    }

    .btn-primary:hover::after {
        width: 200px;
        height: 200px;
        background: rgba(255, 255, 255, 0.2);
    }
}

.btn-primary:active {
    background: linear-gradient(135deg, #001F6B 0%, var(--secondary) 100%);
    transform: translateY(0px);
    box-shadow: 0 2px 8px rgba(0, 42, 147, 0.2);
}

.btn-primary:active::after {
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.2);
    transition: width 0.2s ease, height 0.2s ease, background 0.2s ease;
}

/* Fade-in show class */
.show {
    opacity: 1 !important;
    transform: translateY(0) !important;
}
/* Tablet styles */
@media (min-width: 481px) and (max-width: 768px) {
    .hero {
        padding: 3.5rem 1rem;
    }
    .hero img {
        max-width: 190px;
    }
    .hero h1 {
        font-size: 2.8rem;
    }
    .hero-tagline {
        font-size: 1.3rem;
    }
    .hero-description {
        font-size: 1.15rem;
    }
    .btn-hero {
        font-size: 1.1rem;
        padding: 1.1rem 2.2rem;
    }
    .contact-intro {
        font-size: 1.15rem;
    }
    .section {
        padding: 2.8rem 1.5rem;
    }
    .section h2 {
        font-size: 2.1rem;
    }
    .section p {
        font-size: 1.1rem;
        line-height: 1.65;
    }
    .projects {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .project {
        flex: 1 1 calc(50% - 0.5rem);
        margin-bottom: 1rem;
        padding: 2rem;
        max-width: calc(50% - 0.5rem);
    }
    .project h3 {
        font-size: 1.5rem;
    }
    .project p {
        font-size: 1.05rem;
    }
    .btn {
        font-size: 1.1rem;
        padding: 1.1rem 1.5rem;
    }
    .download a {
        font-size: 1.1rem;
        padding: 1.1rem 1.5rem;
    }
    .contact-buttons {
        justify-content: center;
    }
}

/* Desktop styles */
@media (min-width: 769px) {
    .hero {
        padding: 4.5rem 1rem;
    }
    .hero img {
        max-width: 240px;
    }
    .hero h1 {
        font-size: 3.5rem;
    }
    .hero-tagline {
        font-size: 1.6rem;
    }
    .hero-description {
        font-size: 1.3rem;
    }
    .btn-hero {
        font-size: 1.2rem;
        padding: 1.3rem 2.5rem;
    }
    .contact-intro {
        font-size: 1.25rem;
    }
    .section {
        padding: 3.5rem 2rem;
    }
    .section h2 {
        font-size: 2.5rem;
    }
    .section p {
        font-size: 1.2rem;
        line-height: 1.75;
    }
    .projects {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .project {
        padding: 2.5rem;
    }
    .project h3 {
        font-size: 1.8rem;
    }
    .project p {
        font-size: 1.1rem;
        line-height: 1.65;
    }
    .btn {
        font-size: 1.2rem;
        padding: 1.2rem 2rem;
    }
    .download a {
        font-size: 1.2rem;
        padding: 1.2rem 2rem;
    }
    .contact-buttons {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* Mobile-first optimization using clamp() */
@media (max-width: 768px) {
    .projects {
        gap: clamp(0.5rem, 2vw, 1rem);
    }
}
