/* アトリエ蔦風庵 デザイン・システム */

/* 0. グローバルフォント設定 */
h1, h2, h3, h4 {
    font-family: 'Noto Sans JP', sans-serif !important;
}

.signature-title {
    font-family: 'Noto Serif JP', serif !important;
    color: #1A1A1A !important;
}

.en-font {
    font-family: 'Cormorant Garamond', serif !important;
    font-style: italic;
    font-weight: 500;
}

/* 1. リセット & ベース */
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    font-size: 16px;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* SPサイズ時の本文フォントサイズ調整（16pxから14pxへ） */
@media (max-width: 768px) {
    body, p, li, .text-base {
        font-size: 14px !important;
    }
}

/* 3. セクション見出し */
.section-title-wrap {
    position: relative;
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
}

@media (max-width: 640px) {
    .section-title-wrap {
        width: 80%;
        height: 80px;
    }
}

/* 5. インタラクション & 装飾 */

/* Scroll Top Button Visibility */
#scroll-top.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(-10px);
}

/* Mobile Menu Transition */
#mobile-menu.open {
    opacity: 1;
    pointer-events: auto;
}

/* 6. 画像の扱い共通 */
img {
    vertical-align: bottom;
    object-fit: cover;
}

/* 9. Service Section Background – Wave Animation Compatible */
.bg-service-gradient {
    position: relative;
    background-color: #FDFBF9;
    overflow: hidden;
}

/* Make sure content sits above waves */
.bg-service-gradient > *:not(.pointer-events-none) {
    position: relative;
    z-index: 1;
}

/* 11. Signature Drawing Title (Common) */
.signature-title {
    font-family: 'Cormorant Garamond', serif !important;
    font-style: italic;
    font-size: 4rem;
    font-weight: 500;
    
    /* Bitter Brown solid color */
    background: none !important;
    -webkit-background-clip: initial !important;
    -webkit-text-fill-color: #1A1A1A !important;
    color: #1A1A1A !important;
    
    display: inline-flex;
    flex-direction: column;
    line-height: 1.2;
    letter-spacing: 0.1em;
    padding: 0.1em 0.3em;
    opacity: 0;
    transition: transform 0.6s ease-out, opacity 0.6s ease-out;
    white-space: nowrap;
}

.signature-title .sub-title {
    font-family: 'Noto Sans JP', sans-serif !important;
    font-style: normal;
    font-size: 1.8rem;
    letter-spacing: 0.1em;
    margin-top: 8px;
    opacity: 0.8;
    
    /* Solid Brand Color override to prevent gradient inherit */
    -webkit-text-fill-color: #1A1A1A !important;
    background: none !important;
}

/* スクロールして表示された時にアニメーション開始 */
.signature-title.is-visible {
    animation: premium-reveal 1.5s ease-in-out forwards;
}

@media (max-width: 1024px) {
    .signature-title {
        font-size: clamp(2.5rem, 6vw, 4rem);
    }
    .signature-title .sub-title {
        font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    }
}

@media (max-width: 640px) {
    .signature-title {
        font-size: clamp(1.8rem, 9vw, 2.5rem);
        letter-spacing: 0.05em;
        padding: 0.1em 0.2em;
    }
    .signature-title .sub-title {
        font-size: clamp(1rem, 4.5vw, 1.4rem);
    }
}

@keyframes premium-reveal {
    0% {
        opacity: 0;
        transform: translateY(20px);
        filter: blur(2px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

/* ステッチ風装飾 */
.stitch-border {
    padding: 6px;
    background-color: #fff;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 1px solid #1A1A1A;
}

/* 本文タイトル（About, Service, Recommend などの見出しカード内）のカラー統一 */
h3:not(.signature-title):not(.section-title):not(.text-accent) {
    color: #1A1A1A !important; /* Elegant Bitter Brown */
}

/* recommendations セクションの文字色を強制的にビターブラウンに設定 */
#recommendations h3,
#recommendations span {
    color: #1A1A1A !important;
}

/* カード内の見出しをビターブラウンに指定 */
#menu h3,
#voice h4,
.service-point-title {
    color: #1A1A1A !important;
}

/* 12. Voice Readmore Style */
.readmore-content {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.readmore-content.is-open {
    display: inline;
    opacity: 1;
}
.readmore-btn {
    outline: none;
    margin-top: 12px;
}

/* 13. 3D Card Flip Animation */
.flip-container {
    perspective: 1200px;
}
.flip-card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.flip-card.flipped {
    transform: rotateY(180deg);
}
.flip-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}
.flip-face-back {
    transform: rotateY(180deg);
}

/* 14. じんわりとにじみ広がる水彩アニメーション */
.watercolor-bleed-element {
    transform-origin: center center;
    animation: ink-bleed-in 4s cubic-bezier(0.15, 0.85, 0.35, 1) forwards,
               ink-bleed-float 10s infinite ease-in-out 4s;
}

/* 各要素のディレイ個別指定 */
.ink-delay-1 {
    animation-delay: 0s, 4s;
}
.ink-delay-2 {
    animation-delay: 0.6s, 4.6s;
}
.ink-delay-3 {
    animation-delay: 1.2s, 5.2s;
}
.ink-delay-center {
    animation-delay: 0.3s, 4.3s;
}

/* ページ表示時の「じわーっとにじみ広がる」効果 */
@keyframes ink-bleed-in {
    0% {
        transform: scale(0.2);
        opacity: 0;
        filter: blur(12px);
    }
    40% {
        filter: blur(4px);
    }
    100% {
        transform: scale(1);
        opacity: 1; /* 親要素の opacity クラス(opacity-70など)と連携するため、CSS側では1に設定しラッパー側で全体のブレンドを制御 */
        filter: blur(0px);
    }
}

/* にじみ広がった後の「ゆっくりとした呼吸・ゆらぎ」 */
@keyframes ink-bleed-float {
    0% {
        transform: scale(1) rotate(0deg);
        filter: blur(0px);
    }
    50% {
        transform: scale(1.05) rotate(1.5deg);
        filter: blur(0.5px);
    }
    100% {
        transform: scale(1) rotate(0deg);
        filter: blur(0px);
    }
}

/* --- index.html から集約したスタイル --- */

/* SPサイズ時のヘッダー縦幅固定調整 (50px) */
@media (max-width: 768px) {
    #main-header,
    #main-header.h-20,
    #main-header.h-16 {
        height: 50px !important;
    }
    #main-header>div {
        height: 100% !important;
    }
}

/* 木漏れ日（Komorebi）すっと光が差し込むアニメーション */
.about-komorebi-beam {
    opacity: 0;
    transform: translateY(-80px) scaleY(0.5);
    transform-origin: top center;
    transition: transform 2.0s cubic-bezier(0.16, 1, 0.3, 1), opacity 1.8s ease;
}
.about-komorebi-beam.is-visible {
    opacity: 0.95;
    transform: translateY(0) scaleY(1);
}

/* Aboutセクションのコンテンツ浮き上がりアニメーション */
.about-reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1.2s ease, transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.about-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ゴールド（薄ピンク）のもやもや・霧のようなふわふわアニメーション */
.gold-fog-left-1,
.gold-fog-left-2,
.gold-fog-right-1,
.gold-fog-right-2 {
    position: absolute;
    background: radial-gradient(circle, rgba(244, 200, 207, 0.55) 0%, rgba(244, 200, 207, 0.18) 55%, rgba(253, 251, 249, 0) 75%);
    pointer-events: none;
    z-index: 1;
    filter: blur(45px);
}
/* 左上 */
.gold-fog-left-1 {
    top: 5%;
    left: -160px;
    width: 440px;
    height: 440px;
    animation: gold-fog-float-left 15s ease-in-out infinite alternate;
}
/* 左下 */
.gold-fog-left-2 {
    bottom: 12%;
    left: -200px;
    width: 520px;
    height: 520px;
    animation: gold-fog-float-right 17s ease-in-out infinite alternate;
}
/* 右上 */
.gold-fog-right-1 {
    top: 10%;
    right: -160px;
    width: 460px;
    height: 460px;
    animation: gold-fog-float-right 16s ease-in-out infinite alternate;
}
/* 右下 */
.gold-fog-right-2 {
    bottom: 6%;
    right: -200px;
    width: 540px;
    height: 540px;
    animation: gold-fog-float-left 21s ease-in-out infinite alternate;
}

@keyframes gold-fog-float-left {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        border-radius: 50% 50% 50% 50%;
        opacity: 0.45;
    }
    50% {
        transform: translate(40px, -30px) scale(1.15) rotate(20deg);
        border-radius: 43% 57% 40% 60% / 48% 43% 57% 52%;
        opacity: 0.75;
    }
    100% {
        transform: translate(-20px, 20px) scale(0.95) rotate(-15deg);
        border-radius: 57% 43% 58% 42% / 43% 57% 43% 57%;
        opacity: 0.45;
    }
}

@keyframes gold-fog-float-right {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        border-radius: 50% 50% 50% 50%;
        opacity: 0.45;
    }
    50% {
        transform: translate(-30px, 35px) scale(1.1) rotate(-18deg);
        border-radius: 58% 42% 53% 47% / 42% 58% 42% 58%;
        opacity: 0.75;
    }
    100% {
        transform: translate(20px, -20px) scale(0.95) rotate(12deg);
        border-radius: 42% 58% 42% 58% / 58% 42% 58% 42%;
        opacity: 0.45;
    }
}

/* 1文字ずつ左から流れるアニメーション */
.char-reveal span {
    display: inline-block;
    opacity: 0;
    transform: translateX(-15px);
}
.char-reveal.is-visible span {
    animation: char-fade-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes char-fade-in {
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* サービスセクション 左右からのスライドインアニメーション */
html body .service-slide-in-left {
    opacity: 0 !important;
    transform: translateX(-80px) !important;
    transition: opacity 1.4s cubic-bezier(0.16, 1, 0.3, 1), transform 1.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
    will-change: opacity, transform;
}
html body .service-slide-in-left.is-visible {
    opacity: 1 !important;
    transform: translateX(0) !important;
}

html body .service-slide-in-right {
    opacity: 0 !important;
    transform: translateX(80px) !important;
    transition: opacity 1.4s cubic-bezier(0.16, 1, 0.3, 1), transform 1.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
    transition-delay: 0.15s !important;
    will-change: opacity, transform;
}
html body .service-slide-in-right.is-visible {
    opacity: 1 !important;
    transform: translateX(0) !important;
}

html body .service-slide-in-up {
    opacity: 0 !important;
    transform: translateY(40px) !important;
    transition: opacity 1.4s cubic-bezier(0.16, 1, 0.3, 1), transform 1.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
    will-change: opacity, transform;
}
html body .service-slide-in-up.is-visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* ギャラリー縦フリップ（X軸回転）用スタイル */
.gallery-vertical-container {
    perspective: 1000px;
}
.gallery-vertical-card {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.gallery-vertical-card.flipped {
    transform: rotateX(180deg);
}
.gallery-vertical-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* 3Dカードフリップ */
.flip-card {
    background-color: transparent;
    perspective: 1000px;
    cursor: pointer;
}
.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
}
.flip-card:hover .flip-card-inner,
.flip-card-inner.flipped {
    transform: rotateY(180deg);
}
.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}
.flip-card-front {
    background-color: #FDF0E6;
    color: #1A1A1A;
    z-index: 2;
    overflow: hidden;
}
.flip-card-back {
    background-color: #FDF0E6;
    color: #1A1A1A;
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* --- 和モダンセクション用スタイル --- */

/* 1. 超低速水彩風アニメーション背景 */
@keyframes watercolor-bg {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}
.watercolor-gradient-bg {
    background: linear-gradient(135deg, #FFF5EE 0%, #FAF0E6 50%, #FFF5EE 100%);
    background-size: 200% 200%;
    animation: watercolor-bg 20s ease infinite;
}

/* 2. 手書き風アンダーライン (赤細線) */
.handwritten-underline {
    position: relative;
    display: inline-block;
    z-index: 1;
}
.handwritten-underline::after {
    content: "";
    position: absolute;
    left: -2px;
    right: -2px;
    bottom: 2px;
    height: 3px;
    background-color: #E62E2D;
    opacity: 0.85;
    border-radius: 5px;
    transform: skewX(-15deg) rotate(-0.5deg);
    z-index: -1;
}

