/**
 * 施工の流れページ専用CSS
 * ファイル名: flow-page.css
 * 説明: WordPress用に独立したCSSファイル
 */

/* ========================================
   基本リセット
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* スマホ専用改行 */
.sp-br {
    display: none;
}

@media (max-width: 768px) {
    .sp-br {
        display: block;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', 'Arial', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'Meiryo', sans-serif;
    color: #1a1a1a;
    background: #ffffff;
    line-height: 1.9;
    font-weight: 400;
}

/* ========================================
   特徴セクション
   ======================================== */
.features-section {
    max-width: 1200px;
    margin: 100px auto;
    padding: 0 20px;
    position: relative;
}

.features-section::before {
    content: '';
    position: absolute;
    top: -50px;
    left: 0;
    width: 100%;
    height: 200px;
    background: linear-gradient(180deg, #f8f8f8 0%, transparent 100%);
    z-index: -1;
}

.features-title {
    font-size: 36px;
    font-weight: 900;
    text-align: center;
    margin-bottom: 80px;
    letter-spacing: 0.1em;
    color: #000;
    position: relative;
    padding-top: 70px;
    padding-bottom: 30px;
    text-transform: uppercase;
}

.features-title::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    background: #000;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.features-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, transparent 0%, #000 50%, transparent 100%);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

@media (max-width: 1032px) {
    .features-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

.feature-card {
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
    padding: 50px 40px;
    border: 3px solid #000;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 8px 8px 0 rgba(0,0,0,1);
}

.feature-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(0,0,0,0.02) 10px,
        rgba(0,0,0,0.02) 20px
    );
    pointer-events: none;
}

.feature-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, #000 0%, #444 50%, #000 100%);
}

.feature-card:hover {
    transform: translateY(-12px) translateX(-4px);
    box-shadow: 12px 12px 0 rgba(0,0,0,1);
    border-color: #000;
}

.feature-card:nth-child(1):hover {
    background: linear-gradient(135deg, #f0f0f0 0%, #ffffff 100%);
}

.feature-card:nth-child(2):hover {
    background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
}

.feature-card:nth-child(3):hover {
    background: linear-gradient(135deg, #f8f8f8 0%, #ffffff 100%);
}

.feature-card h3 {
    font-size: 20px;
    font-weight: 900;
    margin-bottom: 30px;
    color: #000;
    padding-bottom: 20px;
    padding-left: 20px;
    letter-spacing: 0.08em;
    position: relative;
    text-transform: uppercase;
}

.feature-card h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 6px;
    height: 100%;
    background: #000;
}

.feature-card h3::after {
    content: '';
    position: absolute;
    left: 20px;
    bottom: 0;
    width: calc(100% - 20px);
    max-width: 200px;
    height: 2px;
    background: #000;
}

.feature-card p {
    font-size: 15px;
    color: #1a1a1a;
    line-height: 2.2;
    font-weight: 400;
    position: relative;
    padding-left: 25px;
}

.feature-card p::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 12px;
    width: 6px;
    height: 6px;
    background: #000;
    transform: rotate(45deg);
}

/* 数字バッジ */
.feature-card:nth-child(1)::before {
    content: '01';
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 48px;
    font-weight: 900;
    color: rgba(0,0,0,0.05);
    line-height: 1;
    z-index: 0;
}

.feature-card:nth-child(2)::before {
    content: '02';
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 48px;
    font-weight: 900;
    color: rgba(0,0,0,0.05);
    line-height: 1;
    z-index: 0;
}

.feature-card:nth-child(3)::before {
    content: '03';
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 48px;
    font-weight: 900;
    color: rgba(0,0,0,0.05);
    line-height: 1;
    z-index: 0;
}

/* ========================================
   フローセクション
   ======================================== */
.flow-section {
    max-width: 900px;
    margin: 120px auto;
    padding: 0 20px;
}

.flow-section-title {
    font-size: 36px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 80px;
    letter-spacing: 0.08em;
    color: #000;
}

.flow-item {
    display: flex;
    gap: 50px;
    margin-bottom: 100px;
    align-items: center;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease forwards;
}

.flow-item:nth-child(2) { animation-delay: 0.1s; }
.flow-item:nth-child(3) { animation-delay: 0.2s; }
.flow-item:nth-child(4) { animation-delay: 0.3s; }
.flow-item:nth-child(5) { animation-delay: 0.4s; }
.flow-item:nth-child(6) { animation-delay: 0.5s; }
.flow-item:nth-child(7) { animation-delay: 0.6s; }
.flow-item:nth-child(8) { animation-delay: 0.7s; }

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

.flow-item:nth-child(even) {
    flex-direction: row-reverse;
}

/* カスタムロゴアイコン */
.flow-icon {
    flex-shrink: 0;
    width: 140px;
    height: 140px;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.flow-icon svg {
    width: 100%;
    height: 100%;
}

.flow-icon:hover svg .icon-bg {
    fill: #000;
    animation: pulse 2s ease;
}

.flow-icon:hover svg .icon-fg {
    stroke: #fff;
    fill: #fff;
}

.flow-icon:hover svg .icon-text {
    fill: #fff;
}

/* ========================================
   各ロゴ専用のアニメーション
   ======================================== */

/* STEP 01: メールが羽ばたいて飛んでいく */
.flow-icon:hover .mail-icon {
    animation: mailFlyAway 2s ease forwards;
}

.flow-icon:hover .mail-wing-left {
    animation: wingFlapLeft 0.3s ease-in-out infinite;
}

.flow-icon:hover .mail-wing-right {
    animation: wingFlapRight 0.3s ease-in-out infinite;
}

@keyframes mailFlyAway {
    0% { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 1; }
    50% { transform: translate(20px, -30px) rotate(-15deg) scale(0.8); opacity: 0.7; }
    100% { transform: translate(40px, -60px) rotate(-25deg) scale(0.5); opacity: 0; }
}

@keyframes wingFlapLeft {
    0%, 100% { transform: rotate(0deg); transform-origin: right center; }
    50% { transform: rotate(-30deg); transform-origin: right center; }
}

@keyframes wingFlapRight {
    0%, 100% { transform: rotate(0deg); transform-origin: left center; }
    50% { transform: rotate(30deg); transform-origin: left center; }
}

/* STEP 02: 望遠鏡の上を星が流れる */
.shooting-star {
    opacity: 0;
}

.flow-icon:hover .shooting-star {
    animation: starFlow 2s ease infinite;
}

@keyframes starFlow {
    0% { transform: translate(-30px, -10px); opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { transform: translate(50px, 10px); opacity: 0; }
}

/* STEP 03: 3種類のマークが順番に配置される */
.blueprint-draw-1,
.blueprint-draw-2,
.blueprint-draw-3,
.blueprint-draw-4 {
    opacity: 1;
}

.flow-icon:hover .blueprint-draw-1 {
    animation: iconAppear1 2s ease forwards;
}

.flow-icon:hover .blueprint-draw-2 {
    animation: iconAppear2 2s ease forwards;
}

.flow-icon:hover .blueprint-draw-3 {
    animation: iconAppear3 2s ease forwards;
}

.flow-icon:hover .blueprint-draw-4 {
    animation: iconAppear4 2s ease forwards;
}

@keyframes iconAppear1 {
    0% { opacity: 0; transform: scale(0) rotate(-180deg); }
    20% { opacity: 1; transform: scale(1.2) rotate(0deg); }
    25% { opacity: 1; transform: scale(1) rotate(0deg); }
    100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes iconAppear2 {
    0%, 25% { opacity: 0; transform: translateY(-10px) scale(0); }
    45% { opacity: 1; transform: translateY(0) scale(1.1); }
    50% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes iconAppear3 {
    0%, 50% { opacity: 0; transform: translateX(10px) scale(0); }
    70% { opacity: 1; transform: translateX(0) scale(1.1); }
    75% { opacity: 1; transform: translateX(0) scale(1); }
    100% { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes iconAppear4 {
    0%, 75% { opacity: 0; transform: scale(0) rotate(180deg); }
    95% { opacity: 1; transform: scale(1.2) rotate(0deg); }
    100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

/* STEP 04: チェックマークが描かれる */
.flow-icon:hover .checkmark {
    animation: drawCheckmark 2s ease forwards;
}

@keyframes drawCheckmark {
    0% { 
        stroke-dashoffset: 50; 
    }
    100% { 
        stroke-dashoffset: 0; 
    }
}

/* STEP 05: 吹き出しが交互にポップアップ */
.dialogue-bubble {
    opacity: 0;
    transform: scale(0);
}

.flow-icon:hover .dialogue-bubble-1 {
    animation: bubblePopup1 2s ease infinite;
}

.flow-icon:hover .dialogue-bubble-2 {
    animation: bubblePopup2 2s ease infinite;
}

@keyframes bubblePopup1 {
    0%, 100% { opacity: 0; transform: scale(0) translateY(5px); }
    10%, 40% { opacity: 1; transform: scale(1) translateY(0); }
    50% { opacity: 0; transform: scale(0) translateY(5px); }
}

@keyframes bubblePopup2 {
    0%, 50% { opacity: 0; transform: scale(0) translateY(5px); }
    60%, 90% { opacity: 1; transform: scale(1) translateY(0); }
    100% { opacity: 0; transform: scale(0) translateY(5px); }
}

/* STEP 06: 工具がフェードインしてくる */
.flow-icon:hover .hammer {
    animation: toolsFadeIn 2s ease forwards;
}

@keyframes toolsFadeIn {
    0% { opacity: 1; transform: scale(1) translateY(0); }
    30% { opacity: 1; transform: scale(1.15) translateY(0); }
    40% { opacity: 1; transform: scale(1) translateY(0); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* STEP 07: パーツが集まって家が完成する */
.flow-icon:hover .house-roof {
    animation: roofAssemble 2s ease forwards;
}

.flow-icon:hover .house-wall {
    animation: wallAssemble 2s ease forwards;
}

.flow-icon:hover .house-door {
    animation: doorAssemble 2s ease forwards;
}

.flow-icon:hover .house-window {
    animation: windowAssemble 2s ease forwards;
}

@keyframes roofAssemble {
    0% { transform: translate(-20px, -20px) scale(0.5); opacity: 0; }
    40% { transform: translate(0, 0) scale(1.1); opacity: 1; }
    50% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(0, 0) scale(1); opacity: 1; }
}

@keyframes wallAssemble {
    0%, 30% { transform: translate(20px, 0) scale(0.5); opacity: 0; }
    60% { transform: translate(0, 0) scale(1.1); opacity: 1; }
    70% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(0, 0) scale(1); opacity: 1; }
}

@keyframes doorAssemble {
    0%, 60% { transform: translate(0, 10px) scale(0.5); opacity: 0; }
    80% { transform: translate(0, 0) scale(1.1); opacity: 1; }
    90% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(0, 0) scale(1); opacity: 1; }
}

@keyframes windowAssemble {
    0%, 70% { transform: scale(0) rotate(180deg); opacity: 0; }
    90% { transform: scale(1.1) rotate(0deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* フローコンテンツ */
.flow-content {
    flex: 1;
}

.flow-content h3 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 18px;
    color: #000;
    letter-spacing: 0.05em;
}

.flow-content .step-number {
    font-size: 14px;
    color: #999;
    letter-spacing: 0.15em;
    margin-bottom: 10px;
    font-weight: 500;
}

.flow-content p {
    font-size: 16px;
    color: #333;
    line-height: 2;
    font-weight: 400;
}

/* ========================================
   レスポンシブ
   ======================================== */
@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: 1fr;
    }

    .flow-item {
        flex-direction: column !important;
        text-align: center;
        gap: 30px;
    }

    .flow-icon {
        width: 100px;
        height: 100px;
    }
}
