/* ========== CSS VARIABLES (Light Mode: Pink & Purple) ========== */
:root {
    /* Colors */
    --bg-color: #faf8fa; /* Very soft off-white/pinkish */
    --text-main: #2d1b36; /* Deep dark purple for high contrast text */
    --text-muted: #6b5c73;
    
    --pink-light: #ffd1dc;
    --pink-primary: #ff85a2;
    --purple-light: #e1bee7;
    --purple-primary: #ab47bc;
    --purple-dark: #7b1fa2;
    
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px 0 rgba(171, 71, 188, 0.1);

    /* Typography */
    --font-main: 'Quicksand', 'Noto Sans JP', sans-serif;
    
    /* Layout */
    --max-width: 1200px;
}

/* ========== RESET & BASE ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* ========== BACKGROUND ORBS (Glassmorphism Effect) ========== */
.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.6;
    animation: float 20s infinite alternate ease-in-out;
}

.orb-pink {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--pink-light), transparent);
    top: -10%;
    left: -10%;
}

.orb-purple {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--purple-light), transparent);
    bottom: 20%;
    right: -10%;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 100px) scale(1.1); }
}

/* ========== TYPOGRAPHY ========== */
h1, h2, h3 {
    font-weight: 800;
    line-height: 1.2;
}

.gradient-text {
    background: linear-gradient(135deg, var(--pink-primary), var(--purple-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========== NAVIGATION ========== */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 5%;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
    transition: background 0.3s ease, backdrop-filter 0.3s ease;
}

.navbar.scrolled {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--purple-dark);
    letter-spacing: -1px;
}

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

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

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 1rem;
    position: relative;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--purple-primary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background: linear-gradient(90deg, var(--pink-primary), var(--purple-primary));
    transition: width 0.3s ease;
}

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

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    border: none;
}

.primary-btn {
    background: linear-gradient(135deg, var(--pink-primary), var(--purple-primary));
    color: white;
    box-shadow: 0 4px 15px rgba(171, 71, 188, 0.4);
}

.primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(171, 71, 188, 0.6);
}

.secondary-btn {
    background: white;
    color: var(--text-main);
    border: 2px solid var(--purple-primary);
}

.secondary-btn:hover {
    background: var(--purple-primary);
    color: white;
    transform: translateY(-3px);
}

/* ========== HERO SECTION ========== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 5%;
    padding-top: 80px;
}

.hero-content {
    max-width: 800px;
    position: relative;
    z-index: 10;
}

.greeting {
    font-size: 1.5rem;
    color: var(--purple-primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.hero-title {
    font-size: clamp(3.5rem, 6vw, 5.5rem);
    color: var(--text-main);
    margin-bottom: 1.5rem;
    letter-spacing: -1px;
    line-height: 1.1;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.3rem);
    color: var(--text-muted);
    margin-bottom: 3rem;
    line-height: 1.8;
}

.description {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ========== PROJECTS SECTION ========== */
.projects-section {
    padding: 100px 5%;
    position: relative;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-main);
}

.projects-list {
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

.project-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: var(--glass-shadow);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 3rem;
}

.project-media {
    flex: 1;
    width: 100%;
}

.project-content {
    flex: 1.2;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(171, 71, 188, 0.2);
    border-color: var(--pink-light);
}

.project-image, .project-video {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    border-radius: 12px;
    margin-bottom: 0;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.mobile-mockup {
    width: auto;
    max-width: 320px;
    height: auto;
    max-height: 550px;
    margin: 0 auto;
    display: block;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    object-fit: contain;
    background: transparent;
}

/* ========== DUMMY UI CROP ========== */
.dummy-ui-wrapper {
    width: 100%;
    height: 400px;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    position: relative;
    margin-bottom: 0;
}

.dummy-ui-img {
    width: 200%;
    max-width: none;
    height: 100%;
    object-fit: cover;
    object-position: left top;
    margin-bottom: 0;
    border: none;
    box-shadow: none;
}

/* ========== TABS ========== */
.image-tabs {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.tab-headers {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.tab-btn {
    padding: 0.6rem 1.5rem;
    border: 2px solid var(--purple-primary);
    background: transparent;
    color: var(--purple-primary);
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: var(--purple-primary);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.tags-container {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.type-badge {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 800;
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    display: inline-block;
}

.type-badge.public {
    background: rgba(76, 175, 80, 0.15);
    color: #2e7d32;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.type-badge.personal {
    background: rgba(33, 150, 243, 0.15);
    color: #1565c0;
    border: 1px solid rgba(33, 150, 243, 0.3);
}

.type-badge.oss {
    background: rgba(0, 150, 136, 0.15);
    color: #00796b;
    border: 1px solid rgba(0, 150, 136, 0.3);
}

/* ========== CUSTOM DIAGRAM ========== */
.custom-diagram {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    font-family: 'Quicksand', 'Noto Sans JP', sans-serif;
    color: var(--text-main);
}
.diag-node {
    background: var(--pink-light);
    border: 2px solid var(--pink-primary);
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}
.diag-arrow {
    font-size: 0.9rem;
    color: var(--purple-primary);
    font-weight: 600;
}
.diag-split {
    display: flex;
    gap: 2rem;
    width: 100%;
    justify-content: center;
}
.diag-branch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}

.project-tag {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--pink-primary);
    font-weight: 800;
    margin-bottom: 0;
}

.project-name {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--purple-dark);
}

.project-link {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: color 0.3s ease;
    position: relative;
}

.project-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background: var(--purple-primary);
    transition: width 0.3s ease;
}

.project-link:hover {
    color: var(--purple-primary);
}

.project-link:hover::after {
    width: 100%;
}

.external-icon {
    opacity: 0.6;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.project-link:hover .external-icon {
    transform: translate(2px, -2px);
    opacity: 1;
}

.project-desc {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    flex-grow: 1;
    line-height: 1.7;
}

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

.tech-stack span {
    background: rgba(225, 190, 231, 0.4);
    color: var(--purple-dark);
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ========== CONTACT SECTION ========== */
.contact-section {
    padding: 100px 5%;
    text-align: center;
    background: linear-gradient(to bottom, transparent, rgba(255, 209, 220, 0.3));
}

.contact-text {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.8;
}

/* ========== FOOTER ========== */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid rgba(0,0,0,0.05);
}

/* ========== ANIMATIONS ========== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
    .project-card {
        flex-direction: column;
        gap: 2rem;
        padding: 1.5rem;
    }
    
    .nav-links {
        display: none;
    }
    
    .hero {
        text-align: left;
    }
    
    .hero-content {
        text-align: left;
    }
}

/* ========== LANGUAGE TOGGLE & VISIBILITY ========== */
body[lang="en"] .ja {
    display: none !important;
}

body[lang="ja"] .en {
    display: none !important;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--purple-primary);
    color: var(--purple-dark);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background: var(--purple-primary);
    color: white;
}
