html {
    scroll-behavior: smooth;
}
body {
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    background: linear-gradient(180deg, #FFF8F6 0%, #FEFDFB 40%, #FFF7F0 100%);
    color: #4A4A4A;
}
.brand {
    font-family: 'Playfair Display', 'Noto Serif JP', serif;
    letter-spacing: 0.02em;
}
.hero-section {
    background-image: url('images/img001.png');
    background-size: cover;
    background-position: center;
    position: relative;
}
.hero-section::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 209, 224, 0.35) 0%, rgba(255, 199, 186, 0.35) 30%, rgba(0,0,0,0.25) 100%);
    pointer-events: none;
}
.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    font-family: 'Playfair Display', 'Noto Serif JP', serif;
    background: linear-gradient(90deg, #A86F86 0%, #D9A581 50%, #E8C6B0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.section-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 3rem;
}
.card {
    background-color: rgba(255, 255, 255, 0.78);
    border-radius: 0.75rem;
    box-shadow: 0 12px 20px -6px rgba(0, 0, 0, 0.10), 0 6px 12px -8px rgba(0, 0, 0, 0.06);
    backdrop-filter: saturate(140%) blur(8px);
    -webkit-backdrop-filter: saturate(140%) blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 28px 32px -16px rgba(0, 0, 0, 0.18), 0 12px 14px -10px rgba(0, 0, 0, 0.08);
}
.cta-button {
    background: linear-gradient(135deg, #E7BBA1 0%, #D9A581 50%, #C08FA9 100%);
    color: white;
    padding: 0.75rem 2.5rem;
    border-radius: 9999px;
    font-weight: 700;
    box-shadow: 0 10px 14px -10px rgba(201, 125, 145, 0.8);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 30px -12px rgba(201, 125, 145, 0.55);
    filter: brightness(1.03);
}
.feature-icon {
    background: linear-gradient(180deg, #FFF1E8 0%, #FFE8F0 100%);
    color: #C08FA9;
    border-radius: 50%;
    padding: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    box-shadow: 0 6px 12px -8px rgba(192, 143, 169, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.8);
}
.faq-item {
    border-bottom: 1px solid #E5E7EB;
}
.faq-question {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    font-size: 1.125rem;
    font-weight: 600;
}
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out;
}

/* Reveal on scroll */
.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 700ms ease, transform 700ms ease;
}
.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}


/* 固定バー */
.selected-size-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 -10px 20px -12px rgba(0,0,0,0.15);
    border-top: 1px solid rgba(0,0,0,0.05);
    backdrop-filter: saturate(140%) blur(8px);
    -webkit-backdrop-filter: saturate(140%) blur(8px);
    z-index: 60;
}
.selected-size-bar.hidden {
    display: none;
}

/* フローティングCTA */
.floating-cta {
    position: fixed;
    right: 18px;
    bottom: 18px;
    padding: 0.875rem 1.25rem;
    z-index: 50;
}
/* 選択バー表示時のフローティングCTA位置補正 */
.selected-size-bar-visible .floating-cta {
    bottom: 84px;
}

/* モバイルメニュー（開閉用の簡易スタイル） */
.mobile-menu {
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 10px 16px -12px rgba(0,0,0,0.18);
}
.mobile-menu.hidden {
    display: none;
}
/* モバイルメニューのオーバーレイ */
#mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 40;
}
#mobile-menu-overlay.hidden {
    display: none;
}

/* フォントプレビュー */
.font-preview-box {
    background: repeating-conic-gradient(#f6f6f6 0% 25%, #ffffff 0% 50%) 50% / 24px 24px;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 0.75rem;
    padding: 24px;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    max-width: 100%;
}
.font-preview-box.show-grid {
    background-image:
        linear-gradient(rgba(0,0,0,0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.06) 1px, transparent 1px),
        repeating-conic-gradient(#f6f6f6 0% 25%, #ffffff 0% 50%);
    background-size: 24px 24px, 24px 24px, 24px 24px;
}
.font-preview-box #fp-output {
    font-size: 48px;
    letter-spacing: 0px;
    text-align: center;
    word-break: keep-all;
    overflow-wrap: anywhere;
}
.font-preview-box #fp-output #fp-l1,
.font-preview-box #fp-output #fp-l2 {
    line-height: 1.2;
}

/* 背景画像を敷いた時にも中央座標で配置できるようにする */
#fp-output {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
}

/* セーフエリア（印刷時のマージンの目安） */
.font-preview-box .safe-area {
    position: absolute;
    inset: 6%;
    border: 2px dashed rgba(217, 165, 129, 0.65);
    border-radius: 8px;
    pointer-events: none;
}

/* 画像がある時は内側の余白を無くして実寸に合わせやすくする */
.font-preview-box.has-image {
    padding: 0;
}

/* レスポンシブ調整 */
@media (max-width: 640px) {
    .section-title {
        font-size: 1.75rem;
        margin-bottom: 0.5rem;
    }
    .section-subtitle {
        margin-bottom: 1.75rem;
        font-size: 0.95rem;
    }
    .cta-button {
        padding: 0.625rem 1.25rem;
        font-size: 0.95rem;
    }
    .floating-cta {
        right: 12px;
        bottom: 12px;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    .card {
        padding: 1rem;
    }
    /* タップ領域を広げる */
    a, button, .faq-question {
        -webkit-tap-highlight-color: transparent;
    }
    .faq-question {
        padding: 1.25rem 0;
    }
    .font-preview-box {
        min-height: 180px;
        padding: 16px;
    }
    .font-preview-box #fp-output {
        font-size: 36px;
    }
    /* ギャラリーや画像の余白を調整し、はみ出しを防止 */
    img {
        max-width: 100%;
        height: auto;
    }
    /* フィルターバーの横スクロール（モバイル） */
    .no-scrollbar {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    .no-scrollbar::-webkit-scrollbar {
        display: none;
    }
    .selected-size-bar .container {
        padding-left: 16px;
        padding-right: 16px;
    }
    /* セーフエリア対応（iOS） */
    body {
        padding-bottom: calc(env(safe-area-inset-bottom) + 0px);
    }
}

/* ベントーグリッド */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(8, 80px);
    grid-auto-rows: 80px; /* 追加: 暗黙の行も同じ高さにする */
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
}

.bento-item {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: #f8f9fa;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.bento-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.bento-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.bento-item:hover .bento-image {
    transform: scale(1.1);
}

.bento-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    color: white;
    padding: 20px 16px 16px;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.bento-item:hover .bento-overlay {
    transform: translateY(0);
}

.bento-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
    font-family: 'Playfair Display', 'Noto Serif JP', serif;
    line-height: 1.2;
}

.bento-description {
    font-size: 0.85rem;
    opacity: 0.95;
    margin: 0;
    line-height: 1.4;
}

/* 3:2比率の横長画像（ランドスケープ） */
.bento-landscape {
    grid-column: span 6; /* 6列 = 3:2比率 */
    grid-row: span 4;    /* 4行 = 3:2比率 */
}

/* 2:3比率の縦長画像（ポートレート） */
.bento-portrait {
    grid-column: span 4; /* 4列 = 2:3比率 */
    grid-row: span 6;    /* 6行 = 2:3比率 */
}

/* メインの横長画像（3:2比率、より大きく） */
.bento-landscape-main {
    grid-column: span 8; /* 8列 = より大きな3:2比率 */
    grid-row: span 5;    /* 5行 = より大きな3:2比率 */
}

/* モバイル対応 */
@media (max-width: 768px) {
    .bento-grid {
        grid-template-columns: repeat(8, 1fr);
        grid-template-rows: repeat(10, 60px);
        grid-auto-rows: 60px; /* 追加: モバイル中幅でも暗黙の行の高さを固定 */
        gap: 12px;
    }
    
    .bento-landscape {
        grid-column: span 8; /* フル幅 */
        grid-row: span 4;    /* 3:2比率を維持 */
    }
    
    .bento-portrait {
        grid-column: span 4; /* 半分の幅 */
        grid-row: span 6;    /* 2:3比率を維持 */
    }
    
    .bento-landscape-main {
        grid-column: span 8; /* フル幅 */
        grid-row: span 5;    /* より大きな3:2比率 */
    }
    
    .bento-overlay {
        padding: 16px 12px 12px;
    }
    
    .bento-title {
        font-size: 1rem;
    }
    
    .bento-description {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .bento-grid {
        grid-template-columns: repeat(6, 1fr);
        grid-template-rows: repeat(12, 50px);
        grid-auto-rows: 50px; /* 追加: モバイル小幅でも暗黙の行の高さを固定 */
        gap: 8px;
    }
    
    .bento-landscape {
        grid-column: span 6; /* フル幅 */
        grid-row: span 4;    /* 3:2比率を維持 */
    }
    
    .bento-portrait {
        grid-column: span 3; /* 半分の幅 */
        grid-row: span 6;    /* 2:3比率を維持 */
    }
    
    .bento-landscape-main {
        grid-column: span 6; /* フル幅 */
        grid-row: span 5;    /* より大きな3:2比率 */
    }
    
    .bento-overlay {
        padding: 12px 10px 10px;
    }
    
    .bento-title {
        font-size: 0.9rem;
    }
    
    .bento-description {
        font-size: 0.75rem;
    }
}

/* マソンリーカードレイアウト */
.masonry {
    column-count: 4;
    column-gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 16px;
    display: inline-block;
    width: 100%;
}

.masonry-card {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.masonry-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.masonry-card img {
    display: block;
    width: 100%;
    height: auto;
}

.masonry-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    color: #fff;
    padding: 14px 12px 12px;
    transform: translateY(100%);
    transition: transform 0.35s ease;
}

.masonry-card:hover .masonry-caption {
    transform: translateY(0);
}

.masonry-caption h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 4px 0;
    font-family: 'Playfair Display', 'Noto Serif JP', serif;
}

.masonry-caption p {
    font-size: 0.85rem;
    margin: 0;
    opacity: 0.95;
}

@media (max-width: 1024px) {
    .masonry {
        column-count: 3;
        column-gap: 14px;
    }
    .masonry-item {
        margin-bottom: 14px;
    }
}

@media (max-width: 768px) {
    .masonry {
        column-count: 2;
        column-gap: 12px;
    }
    .masonry-item {
        margin-bottom: 12px;
    }
}

@media (max-width: 480px) {
    .masonry {
        column-count: 1;
        column-gap: 10px;
    }
    .masonry-item {
        margin-bottom: 10px;
    }
}