main {
    background-color: black;
}

/* ---------- TOP SECTION ---------- */
.services-top {
    width: 100%;
    min-height: 100vh;

    padding: clamp(80px, 6vw, 100px) clamp(30px, 6vw, 100px);

    color: white;
    font-family: 'Noto Sans JP', sans-serif;

    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;

    gap: clamp(20px, 4vw, 40px);
}

.services-title {
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 700;
    
    /* Animation initial state */
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.8s cubic-bezier(0.19, 1, 0.22, 1),
                transform 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}

/* Animated state */
.services-title.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- GRID SECTION ---------- */
/* PC: always 2×2 */
.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    width: 100%;
    border: 1px solid #34363f;
}

.service-box {
    padding: clamp(20px, 4vw, 50px);
    background-color: #2b2d36;

    border-bottom: 1px solid #3a3d47;
    border-right: 1px solid #3a3d47;

    position: relative;
    
    /* Animation initial state */
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.19, 1, 0.22, 1),
                transform 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}

/* Animated state */
.service-box.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Hover effect - only after animation completes */
.service-box.animate-in:hover {
    background-color: #32343d;
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(109, 75, 255, 0.15);
    transition: background-color 0.3s ease,
                transform 0.3s ease,
                box-shadow 0.3s ease;
}

.service-box.animate-in:hover .service-line {
    background: #8b68ff;
    box-shadow: 0 0 12px rgba(109, 75, 255, 0.6);
    transition: background 0.3s ease,
                box-shadow 0.3s ease;
}

/* Tablet & Mobile: 1 column */
@media (max-width: 1080px) {
    .services-grid {
        grid-template-columns: 1fr;
    }
}

/* Remove right border when last column */
@media (min-width: 769px) {
    .services-grid> :nth-child(2n) {
        border-right: none;
    }
}

/* Remove bottom border on last row */
@media (min-width: 769px) {
    .services-grid> :nth-last-child(-n+2) {
        border-bottom: none;
    }
}

/* line highlight */
.service-line {
    width: clamp(4px, 0.6vw, 6px);
    height: clamp(30px, 4vw, 40px);
    background: #6D4BFF;
    border-radius: 4px;

    position: absolute;
    left: clamp(20px, 4vw, 70px);
    top: clamp(20px, 4vw, 40px);
    
    /* Animation initial state */
    opacity: 0;
    transform: scaleY(0);
    transform-origin: top;
    transition: opacity 0.6s cubic-bezier(0.19, 1, 0.22, 1),
                transform 0.6s cubic-bezier(0.19, 1, 0.22, 1);
    transition-delay: 0.2s;
}

/* Animated state */
.service-box.animate-in .service-line {
    opacity: 1;
    transform: scaleY(1);
}

.service-box h3 {
    font-size: clamp(1rem, 2vw, 1.6rem);
    font-weight: 600;
    margin-left: clamp(40px, 5vw, 60px);
    margin-bottom: clamp(10px, 2vw, 20px);
    line-height: 1.4;
    
    /* Animation initial state */
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.7s cubic-bezier(0.19, 1, 0.22, 1),
                transform 0.7s cubic-bezier(0.19, 1, 0.22, 1);
    transition-delay: 0.4s;
}

/* Animated state */
.service-box.animate-in h3 {
    opacity: 1;
    transform: translateX(0);
}

.service-box p {
    font-size: clamp(0.85rem, 1.8vw, 1.1rem);
    line-height: 1.9;
    margin-left: clamp(40px, 5vw, 60px);
    max-width: min(420px, 100%);
    
    /* Animation initial state */
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.7s cubic-bezier(0.19, 1, 0.22, 1),
                transform 0.7s cubic-bezier(0.19, 1, 0.22, 1);
    transition-delay: 0.6s;
}

/* Animated state */
.service-box.animate-in p {
    opacity: 1;
    transform: translateX(0);
}

/* ---------- BOTTOM SECTION (PARALLAX) ---------- */
.service-bottom {
    width: 100%;
    height: clamp(45vh, 55vh, 60vh);

    position: relative;

    background-image: url('../assets/images/service.avif');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;

    display: flex;
    justify-content: center;
    align-items: center;
    
    overflow: hidden;
}

/* Dark overlay */
.service-bottom::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 0;
    
    /* Animation initial state */
    opacity: 0;
    transition: opacity 1s ease;
}

/* Animated state */
.service-bottom.animate-in::after {
    opacity: 1;
}

/* Center content */
.service-center {
    text-align: center;
    color: white;
    z-index: 5;

    padding-inline: clamp(20px, 5vw, 80px);
    
    /* Animation initial state */
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.9s cubic-bezier(0.19, 1, 0.22, 1),
                transform 0.9s cubic-bezier(0.19, 1, 0.22, 1);
}

/* Animated state */
.service-bottom.animate-in .service-center {
    opacity: 1;
    transform: translateY(0);
}

.service-center h2 {
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    font-weight: 600;
    margin-bottom: clamp(20px, 4vw, 50px);
    
    /* Animation initial state */
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.8s cubic-bezier(0.19, 1, 0.22, 1),
                transform 0.8s cubic-bezier(0.19, 1, 0.22, 1);
    transition-delay: 0.2s;
}

/* Animated state */
.service-bottom.animate-in .service-center h2 {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.service-center p {
    font-size: clamp(0.9rem, 1.7vw, 1.1rem);
    opacity: 0.9;
    margin-bottom: clamp(20px, 4vw, 50px);
    line-height: 1.8;
    
    /* Animation initial state */
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s cubic-bezier(0.19, 1, 0.22, 1),
                transform 0.8s cubic-bezier(0.19, 1, 0.22, 1);
    transition-delay: 0.4s;
}

/* Animated state */
.service-bottom.animate-in .service-center p {
    opacity: 0.9;
    transform: translateY(0);
}

/* Button */
.service-btn {
    display: inline-block;
    padding: clamp(0.7rem, 1.6vw, 1rem) clamp(1.4rem, 3vw, 2.5rem);
    background: #6D4BFF;
    color: white;
    border-radius: 999px;
    text-decoration: none;

    font-size: clamp(0.9rem, 1.6vw, 1.1rem);
    font-weight: 600;

    transition: 0.25s ease;
    
    /* Animation initial state */
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    transition: opacity 0.8s cubic-bezier(0.19, 1, 0.22, 1),
                transform 0.8s cubic-bezier(0.19, 1, 0.22, 1),
                background 0.25s ease,
                box-shadow 0.25s ease;
    transition-delay: 0.6s;
}

/* Animated state */
.service-bottom.animate-in .service-btn {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.service-btn:hover {
    background: #8b68ff;
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(109, 75, 255, 0.35);
}