/* ========================================
   AITOLIE - Workflow Section (制作フロー)
   Scroll-Triggered Sticky Design with Triangle
   ======================================== */

/* Gold color palette */
.workflow {
    --gold-light: #E8D5A3;
    --gold: #C9A962;
    --gold-dark: #A68B3D;
}

/* Main Section */
.workflow {
    position: relative;
    background: #0A0A0A;
}

/* Scroll Container - Creates scroll space for 3 steps */
.workflow__scroll-container {
    height: 300vh;
    position: relative;
}

/* Sticky Frame */
.workflow__sticky-frame {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Background Images Layer */
.workflow__backgrounds {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.workflow__bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.workflow__bg.is-active {
    opacity: 1;
}

/* Overlay */
.workflow__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg,
            rgba(10, 10, 10, 0.7) 0%,
            rgba(10, 10, 10, 0.5) 50%,
            rgba(10, 10, 10, 0.8) 100%);
    z-index: 2;
}

/* Content Layer */
.workflow__content {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 1200px;
    padding: 0 var(--container-padding);
}

/* Header */
.workflow__header {
    text-align: center;
    margin-bottom: 40px;
}

.workflow__label {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 16px;
    padding: 8px 20px;
    border: 1px solid rgba(201, 169, 98, 0.3);
    border-radius: 20px;
}

.workflow__title {
    font-size: clamp(28px, 5vw, 48px);
    font-weight: 600;
    color: #FFFFFF;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.workflow__lead {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.8;
}

/* Main Layout: Triangle Left, Panels Right */
.workflow__layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 40px;
    align-items: center;
}

/* ========== Triangle Diagram ========== */
/* Container matches SVG viewBox aspect ratio: 260x220, with padding for labels */
.workflow__triangle {
    position: relative;
    width: 260px;
    height: 220px;
    flex-shrink: 0;
    margin: 40px 50px;
}

/* Triangle SVG fills entire container */
.workflow__triangle-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.workflow__triangle-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.workflow__triangle-line {
    stroke-dasharray: 800;
    stroke-dashoffset: 0;
}

/* Circles positioned at exact SVG vertices using percentages */
/* SVG viewBox: 0 0 260 220, vertices: 130,20 / 240,200 / 20,200 */
.workflow__circles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.workflow__circle {
    position: absolute;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 0.5;
}

.workflow__circle.is-active {
    opacity: 1;
    transform: scale(1.25);
    z-index: 10;
}

/* Circle 1 - Top vertex (130/260=50%, 20/220=9%) */
.workflow__circle--1 {
    top: 9%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(100, 149, 237, 0.35) 0%, rgba(100, 149, 237, 0.1) 100%);
    border: 2px solid rgba(100, 149, 237, 0.8);
    box-shadow: 0 0 15px rgba(100, 149, 237, 0.4);
}

.workflow__circle--1.is-active {
    transform: translate(-50%, -50%) scale(1.25);
    box-shadow: 0 0 30px rgba(100, 149, 237, 0.7);
}

.workflow__circle--1 span {
    color: #6495ED;
    font-weight: 700;
    font-size: 13px;
}

/* Circle 2 - Bottom Right vertex (240/260=92%, 200/220=91%) */
.workflow__circle--2 {
    top: 91%;
    left: 92%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(147, 112, 219, 0.35) 0%, rgba(147, 112, 219, 0.1) 100%);
    border: 2px solid rgba(147, 112, 219, 0.8);
    box-shadow: 0 0 15px rgba(147, 112, 219, 0.4);
}

.workflow__circle--2.is-active {
    transform: translate(-50%, -50%) scale(1.25);
    box-shadow: 0 0 30px rgba(147, 112, 219, 0.7);
}

.workflow__circle--2 span {
    color: #9370DB;
    font-weight: 600;
    font-size: 9px;
    text-align: center;
    line-height: 1.2;
}

/* Circle 3 - Bottom Left vertex (20/260=8%, 200/220=91%) */
.workflow__circle--3 {
    top: 91%;
    left: 8%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(201, 169, 98, 0.4) 0%, rgba(201, 169, 98, 0.15) 100%);
    border: 2px solid var(--gold);
    box-shadow: 0 0 20px rgba(201, 169, 98, 0.4);
}

.workflow__circle--3.is-active {
    transform: translate(-50%, -50%) scale(1.25);
    box-shadow: 0 0 40px rgba(201, 169, 98, 0.7);
}

.workflow__circle--3 span {
    color: var(--gold);
    font-weight: 700;
    font-size: 14px;
}

/* Labels positioned OUTSIDE the triangle container */
.workflow__triangle-labels {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.workflow__triangle-label {
    position: absolute;
    text-align: center;
    white-space: nowrap;
}

/* Top label - above top vertex - move much higher to avoid glow overlap */
.workflow__triangle-label--top {
    top: -55px;
    left: 50%;
    transform: translateX(-50%);
}

/* Right label - right of bottom-right vertex */
.workflow__triangle-label--right {
    bottom: -5px;
    right: -50px;
}

/* Left label - left of bottom-left vertex */
.workflow__triangle-label--left {
    bottom: -5px;
    left: -50px;
}

.workflow__triangle-text {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #FFFFFF;
    margin-bottom: 2px;
}

.workflow__triangle-sub {
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.08em;
    color: var(--gold);
    text-transform: uppercase;
    opacity: 0.6;
}

/* ========== Panels ========== */
.workflow__panels {
    position: relative;
    min-height: 320px;
}

.workflow__panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    pointer-events: none;
}

.workflow__panel.is-active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.workflow__panel-inner {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    background: rgba(20, 20, 20, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(201, 169, 98, 0.2);
    border-radius: 16px;
    padding: 32px;
}

.workflow__step-num {
    font-size: 56px;
    font-weight: 700;
    color: var(--gold);
    opacity: 0.25;
    line-height: 1;
    font-family: 'Inter', sans-serif;
}

.workflow__step-content {
    flex: 1;
}

.workflow__step-tag {
    display: inline-block;
    padding: 5px 12px;
    background: rgba(201, 169, 98, 0.15);
    border: 1px solid rgba(201, 169, 98, 0.3);
    border-radius: 16px;
    font-size: 10px;
    font-weight: 600;
    color: var(--gold);
    letter-spacing: 0.1em;
    margin-bottom: 12px;
}

.workflow__step-title {
    font-size: 26px;
    font-weight: 600;
    color: #FFFFFF;
    margin-bottom: 12px;
    letter-spacing: 0.02em;
}

.workflow__step-desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.8;
    margin-bottom: 16px;
}

.workflow__step-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.workflow__step-list li {
    position: relative;
    padding-left: 18px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 8px;
    line-height: 1.5;
}

.workflow__step-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--gold);
    font-size: 11px;
}

/* Footer Note (Inside sticky frame - bottom of visible area) */
.workflow__footer {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    max-width: 450px;
    z-index: 10;
}

.workflow__note {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.35);
    line-height: 1.5;
}

.workflow__note strong {
    color: rgba(201, 169, 98, 0.7);
    font-weight: 500;
}

/* Step Indicator - positioned far right to avoid overlap */
.workflow__indicator {
    position: absolute;
    bottom: 80px;
    right: -60px;
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-family: 'Inter', sans-serif;
    z-index: 10;
}

.workflow__indicator-current {
    font-size: 40px;
    font-weight: 700;
    color: var(--gold);
}

.workflow__indicator-divider {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.3);
}

.workflow__indicator-total {
    font-size: 20px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.4);
}

/* ========== Responsive ========== */
@media (max-width: 1100px) {
    .workflow__layout {
        gap: 20px;
        grid-template-columns: 320px 1fr;
    }

    .workflow__triangle {
        margin: 40px 0;
        transform: scale(0.9);
    }
}



@media (max-width: 900px) {
    .workflow__layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .workflow__triangle {
        max-width: 280px;
        margin: 0 auto;
    }

    .workflow__scroll-container {
        height: 350vh;
    }
}

@media (max-width: 600px) {

    /* Scroll Container - Reduce for mobile to avoid excessive scrolling */
    .workflow__scroll-container {
        height: auto;
        min-height: auto;
    }

    /* Sticky Frame - Simplified for mobile */
    /* Sticky Frame - Simplified for mobile */
    .workflow__sticky-frame {
        height: auto;
        min-height: auto;
        position: relative;
        /* Disable sticky */
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding: 40px 16px 80px;
        overflow: visible;
        /* Allow overflow */
    }

    /* Content - Full width with safe padding */
    .workflow__content {
        width: 100%;
        max-width: 100%;
        padding: 0;
    }

    /* Header adjustments */
    .workflow__header {
        margin-bottom: 24px;
    }

    .workflow__title {
        font-size: 24px;
    }

    .workflow__lead {
        font-size: 13px;
        padding: 0 8px;
    }

    /* Layout - Stack vertically */
    .workflow__layout {
        display: flex;
        flex-direction: column;
        gap: 20px;
        width: 100%;
    }

    /* Triangle - Hide on very small screens to simplify */
    .workflow__triangle {
        display: none;
    }

    /* Panels - Full width */
    .workflow__panels {
        width: 100%;
        min-height: auto;
        position: relative;
    }

    .workflow__panel {
        position: relative;
        width: 100%;
    }

    .workflow__panel.is-active {
        position: relative;
    }

    .workflow__panel-inner {
        flex-direction: column;
        padding: 20px 16px;
        gap: 8px;
        width: 100%;
        box-sizing: border-box;
    }

    .workflow__step-num {
        font-size: 36px;
        margin-bottom: 4px;
    }

    .workflow__step-content {
        width: 100%;
    }

    .workflow__step-title {
        font-size: 18px;
        line-height: 1.4;
    }

    .workflow__step-desc {
        font-size: 13px;
        line-height: 1.7;
    }

    .workflow__step-list li {
        font-size: 12px;
    }

    /* Indicator - Inside content flow */
    .workflow__indicator {
        position: relative;
        bottom: auto;
        right: auto;
        justify-content: center;
        margin-top: 16px;
    }

    .workflow__indicator-current {
        font-size: 24px;
    }

    .workflow__indicator-divider,
    .workflow__indicator-total {
        font-size: 16px;
    }

    /* Footer - In flow */
    .workflow__footer {
        position: relative;
        bottom: auto;
        left: auto;
        transform: none;
        margin: 24px auto 0;
        padding: 0 16px;
        max-width: 100%;
    }

    .workflow__note {
        font-size: 12px;
    }

    .workflow__note strong {
        display: block;
        margin-bottom: 4px;
    }
}