@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

:root {
    --primary-color-light: #f4f5f7;
    --secondary-color-light: #ffffff;
    --text-color-light: #333;
    --heading-color-light: #111;
    --accent-color-light: #6a5acd;
    --accent-color-hover-light: #5a4bbf;
    --shadow-light: 0 5px 20px rgba(0, 0, 0, 0.07);
    
    --primary-color-dark: #0f0f1a;
    --secondary-color-dark: #161622;
    --text-color-dark: #a0a0c0;
    --heading-color-dark: #e0e0ff;
    --accent-color-dark: #7f5af0;
    --accent-color-hover-dark: #977ff5;
    --shadow-dark: 0 5px 20px rgba(0, 0, 0, 0.25);
    
    --purple-glow: rgba(127, 90, 240, 0.3);
    --easing: cubic-bezier(0.645, 0.045, 0.355, 1);
    --transition-speed: 0.4s;
    --font-main: 'Inter', sans-serif;
}

[data-theme="dark"] {
    --primary-color: var(--primary-color-dark);
    --secondary-color: var(--secondary-color-dark);
    --text-color: var(--text-color-dark);
    --heading-color: var(--heading-color-dark);
    --accent-color: var(--accent-color-dark);
    --accent-color-hover: var(--accent-color-hover-dark);
    --shadow: var(--shadow-dark);
}
[data-theme="light"] {
    --primary-color: var(--primary-color-light);
    --secondary-color: var(--secondary-color-light);
    --text-color: var(--text-color-light);
    --heading-color: var(--heading-color-light);
    --accent-color: var(--accent-color-light);
    --accent-color-hover: var(--accent-color-hover-light);
    --shadow: var(--shadow-light);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-main);
    background-color: var(--primary-color);
    color: var(--text-color);
    transition: background-color var(--transition-speed) var(--easing), color var(--transition-speed) var(--easing);
    font-size: 14px;
    line-height: 1.7;
    overflow-x: hidden;
}

*:focus { outline: none; }
:is(a, button, [tabindex]):focus-visible { box-shadow: 0 0 0 2px var(--primary-color), 0 0 0 4px var(--accent-color); border-radius: 4px; }
.about-photo-wrapper:focus { outline: none !important; }

#particle-canvas, #meteor-canvas { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
#particle-canvas { z-index: -1; }
#meteor-canvas { z-index: -2; display: none; }
[data-theme="dark"] #meteor-canvas { display: block; }

.header { position: fixed; top: 0; left: 0; width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 1rem 5%; z-index: 100; transition: all 0.3s var(--easing); }
.header.scrolled { background-color: rgba(22, 22, 34, 0.5); backdrop-filter: blur(10px); box-shadow: 0 2px 10px rgba(0,0,0,0.2); padding: 0.8rem 5%;}
[data-theme="light"] .header.scrolled { background-color: rgba(255, 255, 255, 0.5); }
.logo { font-size: 1.2rem; font-weight: 600; color: var(--heading-color); text-decoration: none; transition: color var(--transition-speed) var(--easing); }
.navbar a { font-size: 0.9rem; color: var(--text-color); text-decoration: none; margin-left: 1.8rem; transition: color 0.3s var(--easing); position: relative; padding-bottom: 4px; }
.navbar a:hover { color: var(--accent-color); }
.navbar a::after { content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px; background-color: var(--accent-color); transition: width 0.3s var(--easing); }
.navbar a:hover::after, .navbar a.active-link::after { width: 100%; }
.header-controls { display: flex; align-items: center; gap: 1.5rem; }

#theme-switcher {
    cursor: pointer;
    color: var(--heading-color);
    transition: color var(--transition-speed) var(--easing);
    position: relative;
    width: 22px;
    height: 22px;
}
#theme-switcher:hover { transform: scale(1.1); }
#theme-switcher svg {
    position: absolute;
    top: 0;
    left: 0;
    transition: opacity 0.4s var(--easing), transform 0.4s var(--easing);
}
#theme-switcher .sun { opacity: 0; transform: rotate(90deg) scale(0.5); }
#theme-switcher .moon { opacity: 0; transform: rotate(90deg) scale(0.5); }
[data-theme="light"] #theme-switcher .sun { opacity: 1; transform: rotate(0deg) scale(1); }
[data-theme="dark"] #theme-switcher .moon { opacity: 1; transform: rotate(0deg) scale(1); }

#hamburger-menu { display: none; cursor: pointer; width: 24px; height: 18px; position: relative; }
#hamburger-menu .bar { position: absolute; left: 0; width: 100%; height: 2px; background-color: var(--heading-color); border-radius: 2px; transition: all 0.4s var(--easing); }
#hamburger-menu .bar:nth-child(1) { top: 0; }
#hamburger-menu .bar:nth-child(2) { top: 50%; transform: translateY(-50%); }
#hamburger-menu .bar:nth-child(3) { bottom: 0; }
#hamburger-menu.active .bar:nth-child(1) { top: 50%; transform: translateY(-50%) rotate(45deg); }
#hamburger-menu.active .bar:nth-child(2) { opacity: 0; }
#hamburger-menu.active .bar:nth-child(3) { bottom: 50%; transform: translateY(50%) rotate(-45deg); }

.section { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 8rem 5%; max-width: 1100px; margin: 0 auto; }
.section-title { font-size: 2rem; color: var(--heading-color); margin-bottom: 3rem; position: relative; padding-bottom: 0.8rem; text-align: center; }
.section-title::after { content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 60px; height: 3px; background: linear-gradient(90deg, var(--accent-color), var(--accent-color-hover)); border-radius: 2px; }
.section-title::before { content: attr(data-jp); position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: var(--accent-color); font-size: 5rem; font-weight: 700; opacity: 0.05; z-index: -1; white-space: nowrap; }
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.8s var(--easing), transform 0.8s var(--easing); }
.reveal.visible { opacity: 1; transform: translateY(0); }

#welcome { text-align: center; justify-content: center; position: relative; }
.welcome-content h1 { font-size: 3rem; color: var(--heading-color); font-weight: 600; margin-bottom: 0.5rem; }
.welcome-content h2 { font-size: 1.5rem; font-weight: 300; }
#role-text { color: var(--accent-color); font-weight: 500; }
.cursor { animation: blink 0.7s infinite; color: var(--accent-color); }
@keyframes blink { 50% { opacity: 0; } }

.scroll-down { position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%); }
.mouse { width: 25px; height: 45px; border: 2px solid var(--text-color); border-radius: 60px; position: relative; }
.mouse span { width: 4px; height: 4px; position: absolute; top: 8px; left: 50%; transform: translateX(-50%); background-color: var(--accent-color); border-radius: 50%; opacity: 1; animation: wheel 2s infinite; }
@keyframes wheel { to { opacity: 0; top: 25px; } }

.about-container { display: flex; align-items: center; gap: 4rem; width: 100%; }
.about-photo-wrapper { flex-shrink: 0; position: relative; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.about-photo { width: 240px; height: 240px; position: relative; }
#profile-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: clip-path 0.6s var(--easing), opacity 0.3s var(--easing);
    filter: 
        drop-shadow(2px 0 0 var(--accent-color)) 
        drop-shadow(-2px 0 0 var(--accent-color)) 
        drop-shadow(0 2px 0 var(--accent-color)) 
        drop-shadow(0 -2px 0 var(--accent-color))
        drop-shadow(0 0 15px var(--purple-glow));
}
#profile-photo.is-changing { opacity: 0; }
.shape-hexagon { clip-path: polygon(50% 0%, 95% 25%, 95% 75%, 50% 100%, 5% 75%, 5% 25%); }
.shape-square { clip-path: polygon(15% 15%, 85% 15%, 85% 85%, 15% 85%); }
.shape-circle { clip-path: circle(42% at 50% 50%); }
.about-photo::after { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: -1; filter: blur(25px); transform: scale(0.9); background: var(--accent-color); opacity: 0; transition: opacity 0.4s var(--easing); clip-path: inherit; }
.about-photo-wrapper:hover .about-photo::after { opacity: 0.7; }
.about-text p { margin-bottom: 1.5rem; }
.about-details-list { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.about-details-list li { display: flex; align-items: center; gap: 0.8rem; font-size: 0.9rem; }
.about-details-list svg { width: 18px; height: 18px; color: var(--accent-color); flex-shrink: 0; }

.skills-container { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; width: 100%; }
.skills-card { background-color: var(--secondary-color); border-radius: 12px; padding: 2rem; box-shadow: var(--shadow); border: 1px solid transparent; transition: border-color 0.3s var(--easing), transform 0.3s var(--easing); position: relative; overflow: hidden;}
.skills-card:hover { transform: translateY(-5px); border-color: var(--accent-color); }
[data-theme="dark"] .skills-card { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%237f5af0' fill-opacity='0.05'%3E%3Cpath d='M0 38.59l2.83-2.83 1.41 1.41L1.41 40H0v-1.41zM0 1.4l2.83 2.83 1.41-1.41L1.41 0H0v1.41zM38.59 40l-2.83-2.83 1.41-1.41L40 38.59V40h-1.41zM40 1.41l-2.83 2.83-1.41-1.41L38.59 0H40v1.41zM20 18.6l2.83-2.83 1.41 1.41L21.41 20l2.83 2.83-1.41 1.41L20 21.41l-2.83 2.83-1.41-1.41L18.59 20l-2.83-2.83 1.41-1.41L20 18.59z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"); }
.skills-category h3 { font-size: 1.3rem; margin-bottom: 1.5rem; color: var(--heading-color); text-align: center; }
.skill-item { margin-bottom: 1.2rem; }
.skill-item p { font-size: 0.9rem; margin-bottom: 0.5rem; display: flex; justify-content: space-between; font-weight: 500; }
.progress-bar { width: 100%; height: 10px; background-color: var(--primary-color); border-radius: 5px; overflow: hidden; box-shadow: inset 0 1px 3px rgba(0,0,0,0.2); }
.progress { height: 100%; border-radius: 5px; width: 0; transition: width 2s var(--easing); box-shadow: 0 0 10px var(--purple-glow); }
.skills-card:first-child .progress { background: linear-gradient(90deg, #7f5af0, #a885f5); }
.skills-card:last-child .progress { background: linear-gradient(90deg, #007BFF, #3498DB); }

.istri-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; width: 100%; }
.istri-card { position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; cursor: pointer; transition: transform 0.4s var(--easing), box-shadow 0.4s var(--easing); box-shadow: var(--shadow); }
.istri-card:hover { transform: translateY(-8px); box-shadow: 0 15px 30px rgba(0,0,0,0.2); }
.istri-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--easing); }
.istri-card:hover img { transform: scale(1.05); }
.istri-card-name { position: absolute; bottom: 0; left: 0; width: 100%; padding: 1rem; background: linear-gradient(to top, rgba(0,0,0,0.85), transparent); color: #fff; font-weight: 500; font-size: 1rem; transition: opacity 0.4s var(--easing); }
.istri-card-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: radial-gradient(circle at center, rgba(15, 15, 26, 0.3) 0%, rgba(15, 15, 26, 0.95) 100%); backdrop-filter: blur(8px); opacity: 0; pointer-events: none; transition: opacity 0.6s var(--easing); display: flex; justify-content: center; align-items: center; padding: 1.5rem; }
.istri-card.active .istri-card-overlay { opacity: 1; pointer-events: auto; }
.istri-card.active .istri-card-name { opacity: 0; }
.istri-card-info { color: #fff; text-align: center; opacity: 0; transform: translateY(20px); transition: opacity 0.6s var(--easing) 0.2s, transform 0.6s var(--easing) 0.2s; }
.istri-card.active .istri-card-info { opacity: 1; transform: translateY(0); }
.istri-card-info h4 { font-size: 1.4rem; margin-bottom: 0.3rem; }
.istri-card-info p.series { font-style: italic; font-size: 0.8rem; color: var(--text-color-dark); margin-bottom: 1rem; }
.istri-card-info p.description { font-size: 0.85rem; }

.contact-container { width: 100%; max-width: 700px; text-align: center; }
.contact-intro { margin-bottom: 3rem; font-size: 1rem; max-width: 600px; margin-left: auto; margin-right: auto; }
.contact-list { display: flex; flex-direction: column; gap: 1rem; align-items: center; }
.contact-item { width: 100%; max-width: 320px; display: flex; align-items: center; gap: 1rem; background-color: var(--secondary-color); border-radius: 8px; padding: 0.8rem 1.2rem; text-decoration: none; color: var(--text-color); box-shadow: var(--shadow); transition: transform 0.3s var(--easing), box-shadow 0.3s var(--easing); border: 1px solid transparent; }
.contact-item:hover { transform: translateY(-5px); color: var(--accent-color); border-color: var(--accent-color); box-shadow: 0 0 20px var(--purple-glow); }
.contact-item svg { width: 24px; height: 24px; color: var(--accent-color); flex-shrink: 0; }
.contact-item-text { text-align: left; }
.contact-item .contact-text { font-size: 0.9rem; font-weight: 500; color: var(--heading-color); transition: color 0.3s var(--easing); }
.contact-item:hover .contact-text { color: var(--accent-color); }
.contact-item .contact-handle { font-size: 0.8rem; color: var(--text-color); }

.footer { position: sticky; bottom: 0; width: 100%; padding: 1.5rem 5%; background-color: var(--primary-color); font-size: 0.8rem; z-index: 50; transition: background-color var(--transition-speed) var(--easing); border-top: 1px solid rgba(127,90,240,0.1); }
[data-theme="light"] .footer { border-top-color: rgba(0,0,0,0.08); }
.footer-content { max-width: 1100px; margin: 0 auto; text-align: center; }

.back-to-top { position: fixed; bottom: 1.5rem; right: 1.5rem; width: 44px; height: 44px; background-color: var(--accent-color); color: white; border-radius: 50%; display: flex; justify-content: center; align-items: center; z-index: 100; text-decoration: none; opacity: 0; visibility: hidden; transform: translateY(20px); transition: all 0.4s var(--easing); box-shadow: 0 4px 15px var(--purple-glow); }
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background-color: var(--accent-color-hover); transform: translateY(-3px) scale(1.05); }
.back-to-top svg { width: 24px; height: 24px; }

@media (max-width: 768px) {
    body { font-size: 13px; }
    .navbar { position: fixed; top: 0; right: -100%; width: min(75vw, 400px); height: 100vh; background-color: var(--secondary-color); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2rem; transition: right 0.6s var(--easing); box-shadow: -5px 0 20px rgba(0,0,0,0.2); }
    .navbar.active { right: 0; }
    .navbar a { font-size: 1.2rem; margin-left: 0; }
    #hamburger-menu { display: block; z-index: 101; }
    .section { padding: 6rem 5%; }
    .welcome-content h1 { font-size: 2.2rem; }
    .welcome-content h2 { font-size: 1.2rem; }
    .about-container { flex-direction: column; text-align: center; gap: 2.5rem; }
    .about-details-list { grid-template-columns: 1fr; }
    .skills-container { grid-template-columns: 1fr; gap: 1.5rem; }
}