:root {
    --bg-color: #f0f4f8;
    --text-color-primary: #111;
    --text-color-secondary: #333;
    --text-color-muted: #555;
    --accent-color: #007aff;
    --accent-color-hover: #0056b3;
    
    --bg-gradient: linear-gradient(135deg, #a8e0ff 0%, #f6f8ff 100%);
    --shape1-color: linear-gradient(135deg, #00c6ff, #0072ff);
    --shape2-color: linear-gradient(135deg, #f7797d, #FBD786);

    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    
    --item-bg: rgba(255, 255, 255, 0.4);
    --item-shadow: 0 2px 5px rgba(0,0,0,0.05);
    --item-shadow-hover: 0 4px 10px rgba(0,0,0,0.1);
}

html.dark-mode {
    --bg-color: #12121a;
    --text-color-primary: #f0f4f8;
    --text-color-secondary: #c0c0c0;
    --text-color-muted: #888;
    --accent-color: #0088ff;
    --accent-color-hover: #33aaff;

    --bg-gradient: linear-gradient(135deg, #1a237e 0%, #0d1117 100%);
    --shape1-color: linear-gradient(135deg, #3f51b5, #0072ff);
    --shape2-color: linear-gradient(135deg, #d32f2f, #fbc02d);
    
    --glass-bg: rgba(28, 30, 50, 0.25);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
    
    --item-bg: rgba(40, 42, 60, 0.4);
    --item-shadow: 0 2px 5px rgba(0,0,0,0.1);
    --item-shadow-hover: 0 4px 10px rgba(0,0,0,0.2);
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: 'Noto Sans JP', 'Montserrat', sans-serif;
    line-height: 1.7;
    color: var(--text-color-secondary);
    background-color: var(--bg-color);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body {
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    min-height: 100vh;
    padding: 40px 20px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.background-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    transition: background 0.5s ease;
}

.shape1 {
    width: 400px;
    height: 400px;
    background: var(--shape1-color);
    top: 10%;
    left: 15%;
    animation: move1 15s infinite alternate ease-in-out;
}

.shape2 {
    width: 300px;
    height: 300px;
    background: var(--shape2-color);
    bottom: 15%;
    right: 20%;
    animation: move2 20s infinite alternate ease-in-out;
}

@keyframes move1 {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(50px, -30px) scale(1.1); }
}
@keyframes move2 {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(-40px, 20px) scale(0.9); }
}


.container {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    
    padding: 40px;
    animation: fadeIn 1s ease-out;
    transition: background 0.3s ease, border 0.3s ease, box-shadow 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

header {
    text-align: center;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 30px;
    position: relative;
}

header h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--text-color-primary);
}

header .subtitle {
    font-size: 1.2rem;
    font-weight: 300;
    color: var(--text-color-secondary);
}

.theme-switch-wrapper {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
}

#theme-toggle-btn {
    background: none;
    border: none;
    color: var(--text-color-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: color 0.3s ease, background-color 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#theme-toggle-btn:hover {
    color: var(--text-color-primary);
    background-color: rgba(0, 0, 0, 0.05);
}

#theme-toggle-btn .fa-sun {
    display: none;
}
#theme-toggle-btn .fa-moon {
    display: block;
}

html.dark-mode #theme-toggle-btn .fa-sun {
    display: block;
}
html.dark-mode #theme-toggle-btn .fa-moon {
    display: none;
}

html.dark-mode #theme-toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}


section {
    margin-bottom: 40px;
}

section h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-color-primary);
    border-bottom: 2px solid var(--accent-color);
    display: inline-block;
    padding-bottom: 5px;
}

section p {
    font-size: 1rem;
    font-weight: 300;
    max-width: 800px;
}

.skill-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.skill-list li {
    background: var(--item-bg);
    border: 1px solid var(--glass-border);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 400;
    box-shadow: var(--item-shadow);
    transition: all 0.3s ease;
    color: var(--text-color-secondary);
}

.skill-list li:hover {
    transform: translateY(-3px);
    box-shadow: var(--item-shadow-hover);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.portfolio-item {
    background: var(--item-bg);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--item-shadow);
    transition: all 0.3s ease;
}

.portfolio-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--item-shadow-hover);
}

.portfolio-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.portfolio-item h3 {
    font-size: 1.2rem;
    margin: 15px 20px 5px;
    color: var(--text-color-primary);
}

.portfolio-item p {
    font-size: 0.9rem;
    margin: 0 20px 15px;
    padding-bottom: 10px;
    color: var(--text-color-secondary);
}

.btn {
    display: inline-block;
    text-decoration: none;
    background: var(--accent-color);
    color: #fff;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: none;
}

.portfolio-item .btn {
    margin: 0 20px 20px;
}

.btn:hover {
    background: var(--accent-color-hover);
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.3);
}

.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
}

footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
    font-size: 0.9rem;
    color: var(--text-color-muted);
}

@media (max-width: 768px) {
    body {
        padding: 20px 10px;
    }
    
    .container {
        padding: 25px;
    }

    .theme-switch-wrapper {
        position: static;
        justify-content: center;
        margin-bottom: 20px;
    }

    header {
        padding-bottom: 20px;
    }
    
    header h1 {
        font-size: 2.2rem;
    }

    header .subtitle {
        font-size: 1rem;
    }

    section h2 {
        font-size: 1.5rem;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
    }
}

.banner-container {
    display: flex;
    justify-content: center;
    margin-top: 50px;
}

.torn-banner {
    align-items: center;
}
