/* Variables */
:root {
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Noto Sans JP', sans-serif;

    --color-bg: #0a0a0a;
    --color-text: #f0f0f0;
    --color-text-muted: #888888;
    --color-accent: #d4af37;
    /* Gold-ish accent for premium feel */
    --color-card-bg: #1a1a1a;

    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

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

ul {
    list-style: none;
}

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

/* Utilities */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 120px 0;
}

.section-header {
    margin-bottom: 80px;
    text-align: center;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background-color: var(--color-accent);
}

.section-desc {
    font-size: 1rem;
    color: var(--color-text-muted);
}

/* Header */
#header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 20px 0;
    transition: background-color 0.3s ease, padding 0.3s ease;
    mix-blend-mode: difference;
    /* Cool effect over white text/imgs */
    color: #fff;
}

#header.scrolled {
    background-color: rgba(10, 10, 10, 0.95);
    padding: 15px 0;
    mix-blend-mode: normal;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.nav-list {
    display: flex;
    gap: 40px;
    align-items: center;
}

.nav-list a {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    position: relative;
}

.nav-list a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0%;
    height: 1px;
    background-color: var(--color-accent);
    transition: width 0.3s var(--ease-out-expo);
}

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

.btn-contact {
    border: 1px solid #fff;
    padding: 8px 24px;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.btn-contact:hover {
    background-color: #fff;
    color: #000;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../img/ポートフォリオ.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
}

.hero-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(20, 20, 20, 0.3) 0%, rgba(10, 10, 10, 0.8) 100%);
    pointer-events: none;
}

/* Add a subtle grain or noise effect if possible later */

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    /* Centered for now, looks majestic */
    width: 100%;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--color-text-muted);
    font-weight: 300;
    letter-spacing: 0.1em;
}

.scroll-down {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    opacity: 0.6;
}

.scroll-down span {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.scroll-down .line {
    width: 1px;
    height: 60px;
    background-color: #fff;
    position: relative;
    overflow: hidden;
}

.scroll-down .line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background-color: var(--color-bg);
    animation: scrollLine 2s infinite;
}

@keyframes scrollLine {
    0% {
        transform: translateY(-100%);
    }

    100% {
        transform: translateY(200%);
    }
}

/* Services Section */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.service-card {
    background-color: var(--color-card-bg);
    padding: 40px 30px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.4s var(--ease-out-expo), box-shadow 0.4s var(--ease-out-expo), border-color 0.4s ease;
    cursor: default;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(212, 175, 55, 0.3);
    /* Accent color faint border */
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 24px;
    color: var(--color-accent);
}

.service-card h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.service-jp {
    font-size: 0.85rem;
    color: var(--color-accent);
    margin-bottom: 16px;
    font-weight: 500;
}


.service-desc {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    line-height: 1.7;
    margin-bottom: 20px;
}

/* Service Expand Features */
.service-card {
    transition: all 0.4s var(--ease-out-expo);
    position: relative;
    cursor: pointer;
}

.service-summary {
    position: relative;
}

/* expand-icon styles removed */

.service-card.active {
    background-color: #222;
    border-color: var(--color-accent);
    transform: translateY(-5px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

/* active expand-icon styles removed */

.service-details {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.6s var(--ease-out-expo), opacity 0.4s ease;
}

.service-card.active .service-details {
    max-height: 600px;
    /* Arbitrary large height */
    opacity: 1;
    transition: max-height 0.8s var(--ease-out-expo), opacity 0.6s ease 0.2s;
}

.details-content {
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 20px;
}

.details-content img {
    border-radius: 4px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.details-content p {
    font-size: 0.9rem;
    color: #ccc;
    line-height: 1.8;
}

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

.work-item {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.work-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    /* Standard thumbnail ratio */
    overflow: hidden;
}

.work-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease-out-expo);
}

.work-item:hover .work-thumb img {
    transform: scale(1.1);
}

.work-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.2) 60%, transparent);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 30px;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.work-item:hover .work-overlay {
    opacity: 1;
}

.work-overlay h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    margin-bottom: 5px;
    transform: translateY(20px);
    transition: transform 0.5s var(--ease-out-expo);
}

.work-overlay p {
    font-size: 0.9rem;
    color: var(--color-accent);
    transform: translateY(20px);
    transition: transform 0.5s var(--ease-out-expo) 0.1s;
}

.work-item:hover .work-overlay h3,
.work-item:hover .work-overlay p {
    transform: translateY(0);
}

/* Partners Section */
.partners-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
}

.partner-item {
    background-color: #111;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ddd;
    /* Much clearer text */
    font-weight: 500;
    border: 1px solid #333;
    /* Slightly more visible border */
    transition: all 0.3s ease;
    padding: 10px;
    /* Prevent text touching edges */
    text-align: center;
    font-size: 0.95rem;
}

.partner-item:hover {
    border-color: var(--color-accent);
    background-color: #1a1a1a;
    color: #fff;
}

/* Footer */
.footer {
    padding: 80px 0 40px;
    border-top: 1px solid #1a1a1a;
    background-color: #050505;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 40px;
    margin-bottom: 60px;
}

.footer-logo h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.footer-logo p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    gap: 30px;
}

.footer-links a {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--color-accent);
}

.copyright {
    text-align: center;
    font-size: 0.8rem;
    color: #444;
}

/* Animations & Reveal */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s var(--ease-out-expo);
}

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

.reveal-text {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s var(--ease-out-expo) forwards;
}

.reveal-text:nth-child(2) {
    animation-delay: 0.2s;
}

.reveal-text-delay {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s var(--ease-out-expo) forwards 0.5s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsive */
.hamburger {
    display: none;
    cursor: pointer;
}

@media (max-width: 768px) {
    .section {
        padding: 80px 0;
    }

    .hamburger {
        display: block;
        width: 30px;
        height: 20px;
        position: relative;
        z-index: 1001;
    }

    .hamburger span {
        display: block;
        width: 100%;
        height: 2px;
        background-color: #fff;
        position: absolute;
        transition: 0.3s ease;
    }

    .hamburger span:nth-child(1) {
        top: 0;
    }

    .hamburger span:nth-child(2) {
        top: 50%;
        transform: translateY(-50%);
    }

    .hamburger span:nth-child(3) {
        bottom: 0;
    }

    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        /* Full width mobile menu usually looks better */
        height: 100vh;
        background-color: #000;
        display: flex;
        justify-content: center;
        align-items: center;
        transition: 0.4s var(--ease-out-expo);
    }

    .nav.active {
        right: 0;
    }

    .nav-list {
        flex-direction: column;
        gap: 40px;
        text-align: center;
    }

    .nav-list a {
        font-size: 1.5rem;
    }

    .btn-contact {
        font-size: 1.2rem;
        padding: 12px 40px;
    }
}

/* Background Animation Canvas */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 100; /* Above regular bg, below high-level overlays if any, but let's test */
    pointer-events: none; /* Click-through */
    mix-blend-mode: screen; /* Blend nicely with dark backgrounds */
}