html, body {
    overflow-x: hidden;
    width: 100%;
    margin: 0;
    padding: 0;
    position: relative;
    background-color: #ffffff;
}

:root {
    --primary-green: #2d5a27;
    --primary-white: #ffffff;
    --primary-red: #c0392b;
    --bg-light: #ffffff;
    --text-main: #333333;
    --section-margin-sp: 60px;
    --section-margin-pc: 100px;
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    line-height: 1.8;
    letter-spacing: 0.05em;
    font-size: 16px;
    color: var(--text-main);
    user-select: none; /* Right-click/copy protection hint */
}

/* Base Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

section {
    margin-bottom: var(--section-margin-sp);
}

@media (min-width: 1024px) {
    section {
        margin-bottom: var(--section-margin-pc);
    }
}

/* Utilities */
.img-responsive {
    width: 100%;
    height: auto;
    vertical-align: bottom;
    object-fit: cover;
    border-radius: 0;
}

.img-gallery-size {
    width: 320px;
    height: 240px;
    object-fit: cover;
    border-radius: 0 !important;
}

.img-section-size {
    width: 470px;
    height: 340px;
    object-fit: cover;
    border-radius: 0;
}

.img-s1-center {
    object-position: center;
}

.img-responsive {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Section Header Style */
.section-title-container {
    max-width: 50%;
    margin: 0 auto 40px;
    text-align: center;
}

.section-title-text {
    color: var(--primary-red);
    font-size: 2rem;
    font-weight: 600; /* Semibold */
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Header */
header {
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    z-index: 1000;
    position: sticky;
    top: 0;
}

.logo-text {
    color: var(--primary-red);
    font-size: 1.5rem;
    font-weight: 600; /* Semibold */
}

.nav-link {
    color: #000000 !important;
    text-transform: uppercase;
}

.service-text h3 {
    white-space: nowrap; /* No line breaks in service headings */
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-red);
    color: #fff;
    padding: 12px 24px;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-primary:hover {
    opacity: 0.8;
    transform: translateY(-2px);
}

.btn-mercari {
    background-color: #e62117 !important; /* Mercari Red */
    color: #fff !important;
}

/* Parallax */
.parallax-bg {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}



@media (max-width: 768px) {
    .parallax-bg {
        background-attachment: scroll;
    }
}

/* Floating UI */
#back-to-top {
    position: fixed;
    right: 20px;
    bottom: 80px;
    background: var(--primary-green);
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 99;
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

/* Sticky CTA SP */
.sticky-cta-sp {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    display: none;
    grid-template-columns: 1fr 1fr;
    z-index: 1001;
}

@media (max-width: 768px) {
    .sticky-cta-sp {
        display: grid;
    }
}

.sticky-cta-sp a {
    text-align: center;
    padding: 15px;
    color: #fff;
    font-weight: bold;
    text-decoration: none;
}

.cta-tel { background-color: #6ab82c; }
.cta-web { background-color: #ee7529; }

/* Hamburger Menu Overlay */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    z-index: 2000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Gallery Marquee Effect */
.gallery-swiper .swiper-wrapper {
    transition-timing-function: linear !important;
}

.gallery-swiper .swiper-slide {
    width: 320px; /* Match the new smaller img size */
}

.menu-overlay.active {
    display: flex;
}

.menu-overlay a {
    color: #000000;
    font-size: 1.5rem;
    margin: 8px 0;
    text-decoration: none;
}

.close-menu {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #000000;
    font-size: 2rem;
    cursor: pointer;
}

/* Advanced Service Section - Green & White Version */
.bg-animated-gradient {
    background: linear-gradient(-45deg, #2d5a27, #ffffff, #e8f5e9, #ffffff);
    background-size: 400% 400%;
    animation: gradientShift 15s ease-in-out infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.noise-overlay {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.03;
    mix-blend-mode: overlay;
    z-index: 1;
}

.floating-blobs {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    z-index: 0;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: var(--primary-green);
    top: -100px;
    left: -100px;
    animation: float1 25s infinite alternate;
}

.blob-2 {
    width: 350px;
    height: 350px;
    background: #ffffff; /* Replaced red with white */
    bottom: 10%;
    right: -50px;
    animation: float2 30s infinite alternate;
}

.blob-3 {
    width: 500px;
    height: 500px;
    background: #e8f5e9; /* Soft green */
    top: 40%;
    left: 40%;
    opacity: 0.4;
    animation: float3 35s infinite alternate;
}

@keyframes float1 {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(100px, 50px) scale(1.2); }
}

@keyframes float2 {
    from { transform: translate(0, 0) scale(1.1); }
    to { transform: translate(-80px, -100px) scale(0.9); }
}

@keyframes float3 {
    from { transform: translate(0, 0) rotate(0deg); }
    to { transform: translate(50px, 80px) rotate(30deg); }
}

.glass-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: none !important;
    max-width: 600px; /* Increased width to accommodate one-line headings */
    width: 100%;
}

/* Horizontal Slide Animations */
.slide-from-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 1s cubic-bezier(0.25, 1, 0.5, 1);
}

.slide-from-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 1s cubic-bezier(0.25, 1, 0.5, 1);
}

.slow-slide {
    transition-duration: 2.5s !important;
}

.slide-from-bottom {
    opacity: 0;
    transform: translateY(50px);
    transition: all 1s cubic-bezier(0.25, 1, 0.5, 1);
}

.slide-from-top {
    opacity: 0;
    transform: translateY(-50px);
    transition: all 1s cubic-bezier(0.25, 1, 0.5, 1);
}

.animate-in .slide-from-left,
.animate-in .slide-from-right,
.animate-in .slide-from-bottom,
.animate-in .slide-from-top {
    opacity: 1;
    transform: translate(0, 0);
}

/* Force Slide-from-Bottom only for SP */
@media (max-width: 768px) {
    .slide-from-left,
    .slide-from-right,
    .slide-from-top {
        transform: translateY(20px) !important;
    }
}

.service-row {
    opacity: 0;
    transition: opacity 1s ease;
}

.service-row.animate-in {
    opacity: 1;
}

.service-image .image-wrapper {
    box-shadow: none !important;
    transform: translateY(20px);
    opacity: 0;
    transition: all 1s ease 0.2s;
}

.animate-in .image-wrapper {
    transform: translateY(0);
    opacity: 1;
}

.service-image:hover img {
    transform: scale(1.05);
}

@media (max-width: 767px) {
    .glass-card {
        background: rgba(255, 255, 255, 0.95);
        padding: 1rem !important; /* Reduced padding for SP */
    }
    .service-text h3 {
        border-left: 0;
        border-bottom: 3px solid var(--primary-green);
        padding-left: 0;
        padding-bottom: 0.5rem;
        display: inline-block;
    }
    .slide-from-left, .slide-from-right {
        transform: translateY(20px); /* Revert to simple up animation on mobile maybe? Or keep horizontal? User said not from bottom. */
        transform: translateX(0);
        opacity: 0;
    }
    .animate-in .slide-from-left, .animate-in .slide-from-right {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Problems Section Update */
.problems-section {
    background: linear-gradient(-45deg, #c0392b44, #2d5a2744, #c0392b22, #2d5a2722);
    background-size: 400% 400%;
    animation: gradientWave 15s ease infinite;
    position: relative;
    overflow: hidden;
}

@keyframes gradientWave {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.problems-title {
    color: #4a6fa5; /* Blueish color for medical feel from screenshot */
    font-size: 1.8rem;
    font-weight: bold;
}

.problems-card {
    transition: all 0.3s ease;
}

.problems-image img {
    width: 470px;
    height: 340px;
    object-fit: cover;
    border-radius: 0;
}

.problems-list li {
    font-size: 1.1rem;
}

.check-box {
    width: 24px;
    height: 24px;
    background-color: #c0392b;
    border-radius: 4px;
    position: relative;
    flex-shrink: 0;
}

.check-box::after {
    content: '';
    position: absolute;
    left: 8px;
    top: 4px;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

.problems-footer {
    border-top: 1px solid rgba(0,0,0,0.05);
    padding-top: 2rem;
}

@media (max-width: 768px) {
    .problems-title {
        font-size: 1.4rem;
    }
    .problems-content {
        gap: 2rem;
    }
    .check-box {
        width: 20px;
        height: 20px;
    }
    .check-box::after {
        left: 6px;
        top: 2px;
        width: 5px;
        height: 10px;
    }
}

/* Text Lighting Effect - Light Red */
.text-lighting {
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 102, 102, 0.8), 
                 0 0 20px rgba(255, 102, 102, 0.5), 
                 0 0 30px rgba(255, 102, 102, 0.3);
    animation: lightingGlow 3s ease-in-out infinite;
}

@keyframes lightingGlow {
    0%, 100% { 
        text-shadow: 0 0 10px rgba(255, 102, 102, 0.8), 0 0 20px rgba(255, 102, 102, 0.5); 
        color: #fff;
    }
    50% { 
        text-shadow: 0 0 20px rgba(255, 102, 102, 1), 0 0 40px rgba(255, 102, 102, 0.8), 0 0 60px rgba(255, 102, 102, 0.6); 
        color: #fff;
    }
}

/* Slide From Top Animation for Text */
.slide-from-top-text {
    opacity: 0;
    transform: translateY(-50px);
    transition: all 1.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.animate-in.slide-from-top-text,
.animate-in .slide-from-top-text {
    opacity: 1;
    transform: translateY(0);
}

/* Recommend Slider Fixed Height */
.recommend-slider-fixed {
    height: 480px !important; /* Fixed height to prevent image bleed */
}

@media (max-width: 768px) {
}

/* Service Section Image Custom Size & Style */
.service-img-custom {
    width: 470px;
    height: 350px;
    max-width: 100%;
    object-fit: cover;
    border-radius: 0 !important;
    transition: none !important;
    transform: none !important;
}

@media (max-width: 768px) {
    .recommend-slider-fixed {
        height: 380px !important;
    }
    .service-img-custom {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 16 / 9;
        margin: 0 auto;
    }
    .parallax-bg {
        background-attachment: scroll !important;
        background-size: cover !important;
        background-position: center !important;
    }
    .container.relative.z-10 {
        z-index: 20 !important; /* Ensure content is above background overlays */
    }
}

.image-wrapper {
    transition: none !important;
    transform: none !important;
}

.image-wrapper:hover img {
    transform: none !important;
}

/* Staggered Price Animation */
.slide-price {
    opacity: 0;
    transform: translateX(50px);
    transition: all 1.5s cubic-bezier(0.25, 1, 0.5, 1); /* Slower transition */
}

.animate-in .slide-price {
    opacity: 1;
    transform: translateX(0);
}

/* Custom CTA Styles */
.cta-section {
    background-color: #6ab82c !important;
}

.cta-btn {
    background-color: #ee7529 !important;
    color: #ffffff !important;
}

/* Specific fix for S2 image to prevent cropping */
img[src*="S2.jpg"] {
    object-fit: contain !important;
}
