@import url('https://fonts.googleapis.com/css2?family=Zen+Maru+Gothic:wght@300;400;500;700;900&display=swap');

:root {
    --primary-color: #181817; 
    /* 洗練された極暗色 */
    --accent-color: #557733;
    /* 上品なグリーン（アクセント） */
    --text-color: #333333;
    --text-light: #555555;
    --bg-color: #fcfcfc;
    --bg-light: #f4f6f8;
    --white: #ffffff;
    --section-space-pc: 140px;
    --section-space-sp: 90px;
    --font-base: 'Zen Maru Gothic', sans-serif;
    --transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Base Reset & Core Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Smooth scroll for all anchor (#) navigation */
html {
    scroll-behavior: smooth;
}

/* Respect user preference for reduced motion */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

body {
    font-family: var(--font-base);
    color: var(--text-color);
    background-color: var(--bg-color);
    font-size: 16px;
    line-height: 1.8;
    letter-spacing: 0.05em;
    -webkit-font-smoothing: antialiased;
    /* コピペ防止補助 */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    vertical-align: bottom;
}

/* ==============================
   Hamburger Button
============================== */
#hamburger-btn {
    display: none;
}

@media (max-width: 1023px) {
    #hamburger-btn {
        position: relative;
        z-index: 1110;
        width: 44px;
        height: 44px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 6px;
        background: white;
        border: 1px solid rgba(163, 126, 66, 0.2);
        border-radius: 8px;
        cursor: pointer;
        padding: 0;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    }
}

#hamburger-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: #a37e42;
    border-radius: 2px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.2s ease;
    transform-origin: center;
}

/* Animate to × when active */
#hamburger-btn.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

#hamburger-btn.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

#hamburger-btn.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* ==============================
   Mobile Menu Overlay
============================== */
.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: rgba(253, 252, 250, 0.98);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    /* Ensure items start at the top */
    padding: 80px 0 40px;
    /* Space for the close button and room at the bottom */
    overflow-y: auto;
    /* Enable vertical scrolling */
    gap: 0;
    transform: translateX(100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.3s ease,
        visibility 0s linear 0.4s;
    pointer-events: none;
}

.mobile-menu-overlay.active {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.3s ease,
        visibility 0s linear 0s;
    pointer-events: auto;
}

.mobile-menu-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, #cca466, #a37e42);
}

.mobile-menu-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 28px;
    font-weight: 700;
    color: #a37e42;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid #cca466;
    transition: background 0.2s, color 0.2s;
    line-height: 1;
}

.mobile-menu-close:hover {
    background: #a37e42;
    color: #fff;
}

.mobile-link {
    font-size: 1rem;
    /* Slightly smaller font */
    font-weight: 700;
    color: #2c3e50;
    letter-spacing: 0.12em;
    padding: 10px 0;
    /* Reduced vertical padding */
    width: 240px;
    text-align: center;
    border-bottom: 1px solid #f4ebe1;
    transition: color 0.2s;
}

.mobile-link:last-of-type {
    border-bottom: none;
}

.mobile-link:hover {
    color: #a37e42;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0.08em;
}

/* Section Common */
.section {
    margin-bottom: var(--section-space-sp);
}

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

.section-head-img {
    display: block;
    margin: 0 auto 40px;
    max-width: 50%;
    position: relative;
    text-align: center;
}

@media (min-width: 768px) {
    .section-head-img {
        margin: 0 auto 60px;
    }
}

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

.section-head-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--white);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    /* テキストだけは視認性のため影を許可 */
    white-space: nowrap;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    transition: var(--transition);
    border-bottom: 1px solid rgba(163, 126, 66, 0.1);
    height: 70px;
    /* Explicit height for mobile header sanity */
    display: flex;
    align-items: center;
}

@media (min-width: 1024px) {
    .header {
        height: 80px;
    }
}

.nav-link {
    position: relative;
    display: inline-block;
    padding-bottom: 5px;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--accent-color);
    transition: var(--transition);
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 40px;
    font-weight: 500;
    letter-spacing: 0.1em;
    transition: var(--transition);
    border: 1px solid transparent;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: #1a252f;
    color: var(--white);
}

.btn-accent {
    background-color: var(--accent-color);
    color: var(--white);
}

.btn-accent:hover {
    background-color: #bfa032;
    color: var(--white);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

/* FV slider zoom and fade logic */
#fv-slider {
    position: relative;
    width: 100%;
    height: 100%;
}

.fv-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 2s ease-in-out;
    z-index: 0;
}

.fv-slide.active {
    opacity: 1;
    z-index: 1;
}

.fv-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover !important;
    transform: scale(1);
}

.fv-slide.active img,
.fv-slide.fade-out img {
    animation: zoomUp 8s linear forwards;
}

@keyframes zoomUp {
    from {
        transform: scale(1.0);
    }

    to {
        transform: scale(1.15);
    }
}

@media (max-width: 767px) {
    #fv-slider,
    .fv-slide {
        height: 100vw;
    }
}

@media (min-width: 768px) {
    #fv-slider,
    .fv-slide {
        height: 100%;
    }
}

/* Fixed CTA SP */
.sp-fixed-cta {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 900;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

@media (max-width: 767px) {
    .sp-fixed-cta {
        display: flex;
    }
}

.sp-fixed-cta a {
    flex: 1;
    text-align: center;
    padding: 15px 10px;
    font-size: 0.9rem;
    font-weight: 500;
    color: white;
}

.sp-fixed-cta .cta-tel {
    background-color: var(--primary-color);
}

.sp-fixed-cta .cta-web {
    background-color: var(--accent-color);
}

/* Scroll to top */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 800;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

@media (max-width: 767px) {
    .scroll-top {
        bottom: 80px;
        /* SP fixed cta separation */
        right: 15px;
        width: 40px;
        height: 40px;
    }
}

.scroll-top.show {
    opacity: 1;
    visibility: visible;
}

/* Layout Specifics */
/* Overlap Section (Premium Layered Look) */
.overlap-section {
    background-color: #f4efe9;
    padding: 100px 0;
    overflow: hidden;
    position: relative;
    /* Reset scroll margin to prevent header overlap when navigating */
    scroll-margin-top: 80px;
}

.overlap-container {
    max-width: 1240px;
    margin: 0 auto;
    position: relative;
    padding: 0 20px;
    display: flex;
    align-items: center;
}

.overlap-content {
    background-color: #fff;
    padding: 80px 140px 80px 80px;
    width: 80%;
    position: relative;
    z-index: 10;
    box-shadow: 20px 20px 60px rgba(0,0,0,0.03);
}

.overlap-image {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 45%;
    z-index: 20;
    line-height: 0;
}

.overlap-image img {
    width: 100%;
    height: auto;
    box-shadow: 30px 40px 80px rgba(0,0,0,0.12);
    /* Square corners as per reference image */
}

@media (max-width: 1100px) {
    .overlap-content {
        padding: 60px 100px 60px 60px;
        width: 85%;
    }
}

@media (max-width: 860px) {
    .overlap-content {
        padding: 40px 60px 40px 40px;
        width: 90%;
    }
    .overlap-image {
        width: 50%;
    }
}

@media (max-width: 768px) {
    .overlap-section {
        padding: 60px 0;
    }
    .overlap-container {
        display: block;
        padding: 0 15px;
    }
    .overlap-content {
        width: 100%;
        padding: 40px 20px;
        box-shadow: none;
        margin-bottom: 30px;
    }
    .overlap-image {
        position: relative;
        top: 0;
        right: 0;
        transform: none;
        width: 100%;
        padding: 0 15px;
    }
}

/* TV Section (Original, keep if used elsewhere or if needed for legacy) */
.layout-tv .img-wrap {
    width: 100%;
}

/* About Broken Grid */
@media (min-width: 768px) {
    .broken-grid {
        position: relative;
        padding-bottom: 50px;
    }

    .broken-grid-img {
        width: 55%;
        margin-left: auto;
    }

    .broken-grid-text {
        position: absolute;
        top: 20%;
        left: 0;
        width: 50%;
        background: var(--white);
        padding: 60px 40px;
        z-index: 2;
    }
}

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

@media (max-width: 767px) {
    .parallax-bg {
        background-attachment: fixed;
        /* Re-enabled fixed background for SP as requested */
    }
}

/* Voice & Staff Cards */
.card-item {
    background: var(--white);
    padding: 30px;
    height: 100%;
    border: 1px solid #eee;
}

.staff-img-wrap {
    width: 120px;
    height: 120px;
    border-radius: 50% !important;
    /* Here circular is requested in prompt: 丸型アイコン */
    overflow: hidden;
    margin: 0 auto 20px;
}

.staff-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50% !important;
}

/* Gallery Marquee */
@keyframes gallery-marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }

    /* scroll one full set (50% = 8 of 16 items) */
}

.gallery-marquee-wrap {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.gallery-marquee-wrap:hover .gallery-marquee-track {
    animation-play-state: paused;
}

.gallery-marquee-track {
    display: flex;
    flex-wrap: nowrap;
    gap: 16px;
    width: max-content;
    animation: gallery-marquee 24s linear infinite;
    will-change: transform;
}

.gallery-marquee-item {
    flex-shrink: 0;
    width: 220px;
    height: 220px;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    position: relative;
    /* needed for label overlay */
}

@media (min-width: 768px) {
    .gallery-marquee-item {
        width: 300px;
        height: 300px;
    }

    .gallery-marquee-track {
        gap: 24px;
    }
}

.gallery-marquee-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
    transition: transform 0.4s ease;
    display: block;
}

.gallery-marquee-item img:hover {
    transform: scale(1.05);
}

/* Before / After label badge */
.gallery-label {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 5;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    padding: 3px 10px;
    border-radius: 999px;
    pointer-events: none;
    /* don't block clicks on image */
    backdrop-filter: blur(4px);
    line-height: 1.4;
}

.gallery-label.before {
    background: rgba(44, 62, 80, 0.80);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.gallery-label.after {
    background: rgba(163, 126, 66, 0.85);
    color: #fff;
    border: 1px solid rgba(255, 220, 140, 0.35);
}

/* Arrow between Before → After */
.gallery-arrow {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    padding: 0 4px;
}

.gallery-arrow svg {
    width: 40px;
    height: 24px;
    overflow: visible;
}

/* Lightbox overlay */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
    padding: 0;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Image wrapper – keeps image centred and capped in size */
.lightbox-img-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: min(88vw, 900px);
    max-height: 85vh;
    position: relative;
    z-index: 10;
}

.lightbox-img {
    max-width: 100%;
    max-height: 85vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6) !important;
    opacity: 0;
    transform: scale(0.96);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.lightbox-img.loaded {
    opacity: 1;
    transform: scale(1);
}

/* Close button */
.lightbox-close {
    position: absolute;
    top: 18px;
    right: 20px;
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(6px);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: background 0.2s ease, transform 0.2s ease;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

/* Prev / Next nav buttons */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(6px);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: background 0.2s ease, transform 0.25s ease;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.28);
    transform: translateY(-50%) scale(1.12);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

@media (max-width: 640px) {
    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-nav {
        width: 40px;
        height: 40px;
    }
}

/* Image counter  e.g. "2 / 4" */
.lightbox-counter {
    position: absolute;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.1em;
    background: rgba(0, 0, 0, 0.4);
    padding: 4px 14px;
    border-radius: 999px;
    backdrop-filter: blur(4px);
    z-index: 20;
    white-space: nowrap;
}

/* SNS Line Logo overrides */
.line-icon {
    width: 40px;
    /* Appropriate size */
    height: 40px;
    vertical-align: middle;
}

/* =============================================
   Scroll-triggered Animations
   Elements start hidden; .is-visible adds the final state.
   Uses will-change for GPU compositing.
   ============================================= */

/* Fade-in from below */
.anim-fade-up {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

.anim-fade-up.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Fade-in from above */
.anim-fade-down {
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

.anim-fade-down.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Fade-in from left */
.anim-fade-left {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

.anim-fade-left.is-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Fade-in from right */
.anim-fade-right {
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

.anim-fade-right.is-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Simple fade-in (no movement) */
.anim-fade {
    opacity: 0;
    transition: opacity 1s ease;
    will-change: opacity;
}

.anim-fade.is-visible {
    opacity: 1;
}

/* Subtle zoom entrance (for hero images) */
.anim-zoom-hero {
    opacity: 0;
    transform: scale(1.1);
    transition: opacity 1.2s ease, transform 1.5s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

.anim-zoom-hero.is-visible {
    opacity: 1;
    transform: scale(1);
}

/* Stagger delay helpers (for sibling groups) */
.anim-delay-1 {
    transition-delay: 0.10s;
}

.anim-delay-2 {
    transition-delay: 0.20s;
}

.anim-delay-3 {
    transition-delay: 0.30s;
}

.anim-delay-4 {
    transition-delay: 0.40s;
}

.anim-delay-5 {
    transition-delay: 0.50s;
}

/* When user prefers reduced motion – skip all animations instantly */
@media (prefers-reduced-motion: reduce) {

    .anim-fade-up,
    .anim-fade-left,
    .anim-fade-right,
    .anim-fade {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* ===================================
   SP Only: reduce px-6 padding
   Applies ONLY on smartphones (≤767px)
=================================== */
@media (max-width: 767px) {
    .px-6 {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .p-8 {
        padding: 1rem !important;
    }
}

/* ==============================
   Case Slider Custom Pagination
============================== */
.case-slider .swiper-pagination {
    bottom: 20px !important;
}

.case-slider .swiper-pagination-bullet {
    background: #ffffff !important;
    opacity: 0.5;
    width: 10px;
    height: 10px;
    transition: all 0.3s ease;
}

.case-slider .swiper-pagination-bullet-active {
    background: #557733 !important;
    opacity: 1;
    width: 24px;
    border-radius: 5px;
}

/* Voice Section Dots Background (Perfect Round Dots) */
.dots-bg {
    background-color: #ffffff;
    background-image: 
        radial-gradient(circle, #557733 2.5px, transparent 3px),
        radial-gradient(circle, #94a3b8 2.5px, transparent 3px);
    background-size: 48px 48px;
    background-position: 0 0, 24px 24px;
}

/* ==============================
   Reveal Mask Animation (リビール効果)
   ============================== */
.reveal-mask {
    position: relative;
    overflow: hidden;
    display: block;
}

/* 遮蔽物のカーテン */
.reveal-mask::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f4ebe1; /* クリニックのブランドベージュ */
    z-index: 10;
    transform: scaleX(1);
    transform-origin: left;
    transition: transform 1.2s cubic-bezier(0.19, 1, 0.22, 1);
}

/* 表示された時のカーテンの動き（右に消える） */
.reveal-mask.is-visible::after {
    transform: scaleX(0);
    transform-origin: right;
}

/* 中の画像のアニメーション（少しズームアウトして整う） */
.reveal-mask img {
    opacity: 0;
    transform: scale(1.2);
    transition: opacity 0.5s ease 0.4s, transform 1.6s cubic-bezier(0.19, 1, 0.22, 1) 0.3s;
}

.reveal-mask.is-visible img {
    opacity: 1;
    transform: scale(1);
}

/* ==============================
   Service Fluid Gradient Background
   ============================== */
.bg-fluid-anim {
    background-color: #ffffff;
    background-image: 
        radial-gradient(circle at 10% 10%, rgba(228, 213, 199, 0.5) 0px, transparent 25%),
        radial-gradient(circle at 90% 20%, rgba(210, 225, 198, 0.4) 0px, transparent 30%),
        radial-gradient(circle at 30% 80%, rgba(210, 225, 198, 0.5) 0px, transparent 25%),
        radial-gradient(circle at 80% 90%, rgba(228, 213, 199, 0.5) 0px, transparent 30%);
    background-size: 200% 200%;
    animation: fluidMesh 18s ease infinite alternate;
}

@keyframes fluidMesh {
    0% {
        background-position: 0% 0%;
    }
    33% {
        background-position: 100% 0%;
    }
    66% {
        background-position: 100% 100%;
    }
    100% {
        background-position: 0% 100%;
    }
}