:root {
    --bg-color: #050505;
    --text-color: #e0e0e0;
    --accent-color: #00f3ff;
    /* Cyan Neon */
    --accent-color-2: #bc13fe;
    /* Purple Neon */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --font-heading: 'Orbitron', 'M PLUS 2', sans-serif;
    /* Added Japanese heading font */
    --font-body: 'Noto Sans JP', sans-serif;
    /* Clean modern body font */
}

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

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

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

/* Custom Cursor Removed */

/* Hero Image Width Adjustment */
.hero-img-container {
    width: 80%;
    /* PC Default */
    height: 100%;
    margin: 0 auto;
    /* Center */
    display: block;
    position: relative;
    z-index: 2;
}

/* ... existing styles ... */

/* Mobile Responsiveness */
@media screen and (max-width: 768px) {
    /* ... existing mobile styles ... */

    .hero-img-container {
        width: 95%;
        /* Mobile Width */
    }
}

/* Contact Revert to Left */
.contact-section {
    text-align: left;
}

.social-links {
    justify-content: flex-start;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 20px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(5, 5, 5, 0.5);
}

.logo {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 1.5rem;
    color: var(--accent-color);
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.5);
}

.nav ul {
    display: flex;
    gap: 30px;
    list-style: none;
}

.nav a {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    letter-spacing: 2px;
}

.nav a:hover {
    color: var(--accent-color);
    text-shadow: 0 0 8px var(--accent-color);
}

/* Hero Section */
/* Hero Section */
.hero-section {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: var(--bg-color);
    /* Ensure dark background */
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Center correctly */
}

/* Blurred background to fill space */
.hero-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/images/profile.jpg');
    background-size: cover;
    background-position: center;
    filter: blur(30px) opacity(0.2) grayscale(100%);
    z-index: -1;
}

.hero-img {
    width: 100%;
    /* Fill container */
    height: 100%;
    object-fit: cover;
    /* Changed from contain to cover to strictly fill the 80%/95% width */
    object-position: center top;
    /* Focus on faces/top part */
    /* Mask to fade edges */
    mask-image: linear-gradient(to right, transparent 0%, black 15%, black 85%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 15%, black 85%, transparent 100%);
    filter: contrast(1.1);
    opacity: 1;
    position: relative;
    z-index: 2;
    /* Image above overlay */
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Darker gradient for text readability */
    background: radial-gradient(circle at center, transparent 40%, var(--bg-color) 90%);
    z-index: 1;
    /* Below image */
}

.hero-content {
    text-align: center;
    z-index: 3;
    /* Top */
    width: 100%;
    position: absolute;
    top: 75%;
    /* Moved down to avoid covering face */
    transform: translateY(-50%);
    mix-blend-mode: normal;
    pointer-events: none;
}

.hero-content h1 {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 6vw, 4rem);
    /* Smaller font size as requested */
    font-weight: 900;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 5px;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    background: rgba(0, 0, 0, 0.2);
    /* Slight backdrop */
    backdrop-filter: blur(3px);
    display: inline-block;
    padding: 0 20px;
}

.hero-content .subtitle-ja {
    font-size: clamp(1rem, 2vw, 1.5rem);
    font-weight: 300;
    letter-spacing: 3px;
    margin-bottom: 20px;
    color: var(--accent-color);
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.3);
}

.hero-content .vision {
    font-size: 1rem;
    opacity: 0.8;
    letter-spacing: 2px;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 20px;
    /* Moved down to separate from text */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    opacity: 0.7;
}

.scroll-indicator span {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    letter-spacing: 2px;
}

.scroll-indicator .line {
    width: 1px;
    height: 50px;
    background: linear-gradient(to bottom, var(--accent-color), transparent);
    animation: scrollDown 2s infinite;
}

@keyframes scrollDown {
    0% {
        transform: scaleY(0);
        transform-origin: top;
    }

    50% {
        transform: scaleY(1);
        transform-origin: top;
    }

    51% {
        transform: scaleY(1);
        transform-origin: bottom;
    }

    100% {
        transform: scaleY(0);
        transform-origin: bottom;
    }
}

/* Sections */
.section {
    padding: 100px 50px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    max-width: 1200px;
    width: 100%;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 3rem;
    color: transparent;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.3);
    margin-bottom: 50px;
    position: relative;
    padding-left: 20px;
    border-left: 3px solid var(--accent-color);
}

/* About */
.about-text h3 {
    font-size: 2rem;
    margin-bottom: 20px;
    background: linear-gradient(90deg, #fff, var(--accent-color-2));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.about-text p {
    font-size: 1.1rem;
    line-height: 2;
    margin-bottom: 30px;
    max-width: 800px;
}

.skills-list {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    list-style: none;
}

.skills-list li {
    padding: 10px 20px;
    border: 1px solid var(--glass-bg);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 50px;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    transition: 0.3s;
}

.skills-list li:hover {
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.2);
}

/* Works */
.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.work-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    transition: 0.3s;
    cursor: pointer;
    display: block;
    /* For anchor tags */
    height: 100%;
}

.work-card:hover {
    border-color: var(--accent-color-2);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(188, 19, 254, 0.15);
}

.work-thumb {
    height: 200px;
    background: #111;
    position: relative;
    overflow: hidden;
}

/* Placeholder pattern for thumb - Only for non-active (placeholders) */
.work-card:not(.active-work) .work-thumb::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(45deg, #1a1a1a 25%, transparent 25%),
        linear-gradient(-45deg, #1a1a1a 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #1a1a1a 75%),
        linear-gradient(-45deg, transparent 75%, #1a1a1a 75%);
    background-size: 20px 20px;
    opacity: 0.3;
}

.work-info {
    padding: 20px;
}

.work-info h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: var(--text-color);
}

.work-meta {
    margin-bottom: 10px;
    color: var(--accent-color);
    font-size: 0.9rem;
    font-weight: bold;
}

.work-concept {
    font-size: 0.85rem;
    color: #aaa;
    line-height: 1.5;
}

/* Contact */
/* Contact */
.contact-section {
    text-align: left;
}

.contact-section p {
    font-size: 1.5rem;
    margin-bottom: 40px;
}

.btn {
    display: inline-block;
    padding: 15px 40px;
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    font-family: var(--font-heading);
    font-weight: bold;
    letter-spacing: 2px;
    border-radius: 5px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--accent-color);
    z-index: -1;
    transition: 0.3s;
}

.btn:hover {
    color: #000;
    box-shadow: 0 0 20px var(--accent-color);
}

.btn:hover::before {
    left: 0;
}

.social-links {
    margin-top: 50px;
    display: flex;
    justify-content: flex-start;
    /* Aligned to left to match text */
    gap: 30px;
}

.social-links a {
    font-family: var(--font-heading);
    opacity: 0.7;
}

.social-links a:hover {
    opacity: 1;
    color: var(--accent-color-2);
}

/* Footer */
.footer {
    padding: 50px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.8rem;
    color: #555;
    position: relative;
    z-index: 10;
}

/* Animations */
.fade-in-section {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 1.5s ease-out, transform 1.5s ease-out;
    /* Slow and elegant */
    will-change: opacity, transform;
}

.fade-in-section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Background Grid Effect */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 200%;
    height: 200%;
    background-image:
        linear-gradient(rgba(0, 243, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 243, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -2;
    transform: perspective(500px) rotateX(60deg) translateY(-100px) translateZ(-200px);
    animation: gridMove 20s linear infinite;
    pointer-events: none;
}

@keyframes gridMove {
    0% {
        transform: perspective(500px) rotateX(60deg) translateY(0) translateZ(-200px);
    }

    100% {
        transform: perspective(500px) rotateX(60deg) translateY(50px) translateZ(-200px);
    }
}

/* Glitch Effect for Title */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
}

.glitch::before {
    left: 2px;
    text-shadow: -1px 0 red;
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim-1 3s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -1px 0 blue;
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim-2 2s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
    0% {
        clip: rect(20px, 9999px, 15px, 0);
    }

    20% {
        clip: rect(60px, 9999px, 70px, 0);
    }

    40% {
        clip: rect(20px, 9999px, 20px, 0);
    }

    60% {
        clip: rect(10px, 9999px, 50px, 0);
    }

    80% {
        clip: rect(60px, 9999px, 20px, 0);
    }

    100% {
        clip: rect(40px, 9999px, 80px, 0);
    }
}

@keyframes glitch-anim-2 {
    0% {
        clip: rect(90px, 9999px, 100px, 0);
    }

    20% {
        clip: rect(30px, 9999px, 10px, 0);
    }

    40% {
        clip: rect(80px, 9999px, 30px, 0);
    }

    60% {
        clip: rect(10px, 9999px, 60px, 0);
    }

    80% {
        clip: rect(50px, 9999px, 40px, 0);
    }

    100% {
        clip: rect(20px, 9999px, 90px, 0);
    }
}

/* =========================================
   RESPONSIVE DESIGN SYSTEM
   ========================================= */

/* --- Tablet / Laptop (max-width: 1024px) --- */
@media screen and (max-width: 1024px) {
    .section-title {
        font-size: 2.5rem;
    }

    .hero-content h1 {
        font-size: clamp(2.5rem, 7vw, 5rem);
    }
}

/* --- Mobile (max-width: 768px) --- */
@media screen and (max-width: 768px) {

    /* 1. Header Fixes */
    .header {
        padding: 15px 15px;
        background: rgba(5, 5, 5, 0.95);
        /* High opacity for readability */
        flex-direction: column;
        /* Stack logo and nav if really tight, or keep row with small fonts */
        align-items: center;
        gap: 10px;
    }

    .logo {
        font-size: 1.2rem;
        /* Reduced from 1.5rem */
        white-space: nowrap;
        width: 100%;
        text-align: center;
    }

    .nav {
        width: 100%;
    }

    .nav ul {
        gap: 15px;
        justify-content: center;
        /* Center nav items */
        padding: 0;
    }

    .nav a {
        font-size: 0.75rem;
        letter-spacing: 1px;
    }

    /* 2. Hero Image Fix (Remove top blank space) */
    .hero-bg {
        align-items: flex-start;
        /* Move image to top */
        padding-top: 80px;
        /* Offset for header */
    }

    .hero-img {
        object-fit: cover;
        /* Ensure filling width on mobile too */
        object-position: center top;
        /* Ensure it stays at top */
        height: 60vh;
        /* Allow space for text below */
    }

    /* 3. Hero Title Fix (Prevent cutoff) */
    .hero-content {
        top: 60%;
        /* Adjusted position */
        padding: 0 10px;
        width: 100%;
    }

    .hero-content h1 {
        font-size: clamp(1rem, 6vw, 2rem);
        /* Adjusted to fit "Yuki Hamaguchi" without clipping */
        white-space: nowrap;
        margin-bottom: 5px;
        width: 100%;
        /* Ensure centering works */
        overflow: visible;
        /* Prevent accidental clipping */
    }

    .hero-content .subtitle-ja {
        font-size: 0.9rem;
        margin-bottom: 10px;
    }

    .scroll-indicator {
        bottom: 15px;
    }

    /* 4. Section Title & Layout Fixes */
    .section {
        padding: 60px 20px;
    }

    .section-title {
        font-size: 1.8rem;
        margin-bottom: 30px;
        padding-left: 10px;
        /* Reduced padding */
        border-left-width: 2px;
        /* Thinner accent line */
    }

    /* Single Column for Works */
    .works-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .contact-section p {
        font-size: 1.1rem;
    }

    /* Fix Font Hierarchy on Mobile */
    .about-text h3 {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }

    .about-text p {
        font-size: 0.9rem;
        line-height: 1.6;
    }

    .skills-list li {
        font-size: 0.75rem;
        padding: 5px 10px;
    }
}