:root {
    --primary-color: #437199;
    --text-main: #1a1a1a;
    --text-light: #777777;
    --bg-body: #ffffff;
    --font-serif: 'Noto Serif JP', serif;
    --font-sans: 'Noto Sans JP', sans-serif;
    --font-en: 'Playfair Display', serif;
    --floating-action-bg: linear-gradient(135deg, #5e89b0 0%, var(--primary-color) 100%);
    --floating-action-border: 1px solid rgba(255, 255, 255, 0.24);
    --floating-action-shadow: 0 14px 32px rgba(39, 67, 94, 0.28);
    --floating-action-shadow-hover: 0 16px 36px rgba(39, 67, 94, 0.34);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-sans);
    color: var(--text-main);
    background-color: var(--bg-body);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; transition: all 0.4s ease; }
img { max-width: 100%; height: auto; vertical-align: bottom; }
ul { list-style: none; }

.container { max-width: 1000px; margin: 0 auto; padding: 0 5%; }

.mobile-contact-btn {
    display: none;
    position: fixed;
    right: 14px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 96px);
    z-index: 111;
    width: 68px;
    height: 68px;
    align-items: center;
    justify-content: center;
    border: var(--floating-action-border);
    border-radius: 50%;
    background: var(--floating-action-bg);
    box-shadow: var(--floating-action-shadow);
    color: #fff;
    opacity: 0;
    transform: translateY(20px);
    animation: mobileCallBtnFade 1.5s 1s forwards cubic-bezier(0.2, 0.8, 0.2, 1);
}

.mobile-contact-btn__icon {
    width: 100%;
    height: 100%;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.mobile-contact-btn__icon svg {
    width: 22px;
    height: 22px;
}

.mobile-contact-btn__label {
    font-family: var(--font-sans);
    font-size: 8.5px;
    font-weight: 500;
    letter-spacing: 0.05em;
    line-height: 1;
    margin-top: 4px;
    white-space: nowrap;
}

.mobile-contact-btn:hover {
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: var(--floating-action-shadow-hover);
}

.mobile-contact-btn:active {
    transform: scale(0.98);
}

.mobile-contact-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.6), var(--floating-action-shadow-hover);
}

.mobile-call-btn {
    display: none;
    position: fixed;
    right: 14px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
    z-index: 110;
    width: 68px;
    height: 68px;
    align-items: center;
    justify-content: center;
    border: var(--floating-action-border);
    border-radius: 50%;
    background: var(--floating-action-bg);
    box-shadow: var(--floating-action-shadow);
    color: #fff;
    opacity: 0;
    transform: translateY(20px);
    animation: mobileCallBtnFade 1.5s 1.2s forwards cubic-bezier(0.2, 0.8, 0.2, 1);
}

.mobile-call-btn__icon {
    width: 100%;
    height: 100%;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.mobile-call-btn__icon svg {
    width: 22px;
    height: 22px;
}

.mobile-call-btn__label {
    font-family: var(--font-sans);
    font-size: 8.5px;
    font-weight: 500;
    letter-spacing: 0.05em;
    line-height: 2.2;
    margin-top: 3px;
}

.mobile-call-btn:hover {
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: var(--floating-action-shadow-hover);
}

.mobile-call-btn:active {
    transform: scale(0.98);
}

.mobile-call-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.6), var(--floating-action-shadow-hover);
}

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

@media (max-width: 900px) {
    .mobile-contact-btn,
    .mobile-call-btn {
        display: inline-flex;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 8%;
    }

    .mobile-contact-btn {
        right: 12px;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 96px);
        width: 68px;
        height: 68px;
    }

    .mobile-call-btn {
        right: 12px;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
        width: 68px;
        height: 68px;
    }

    .mobile-contact-btn__icon svg,
    .mobile-call-btn__icon svg {
        width: 22px;
        height: 22px;
    }

    .mobile-contact-btn__label {
        font-size: 8.5px;
        margin-top: 3px;
    }

    .mobile-call-btn__label {
        font-size: 8.5px;
        margin-top: 3px;
    }
}

.flip-inner {
    position: relative;
    display: inline-block;
    transform-style: preserve-3d;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
}

.flip-front {
    display: block;
    backface-visibility: hidden;
    transform: translateZ(10px);
}

.flip-back {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%) rotateX(90deg) translateZ(10px);
    display: block;
    white-space: nowrap;
    backface-visibility: hidden;
}

a:hover .flip-inner {
    transform: rotateX(-90deg);
}
