/* なぜAIを使うのか：日本語見出しを主役にする */
#ai-why > .ae-ai__section-heading {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 24px;
    margin-bottom: 32px;
    text-align: left;
}

/* 中央寄せの余白を解除し、日本語を大きく */
#ai-why #ai-why-title {
    max-width: none;
    margin: 0;
    color: var(--ai-ink);
    font-size: clamp(26px, 3vw, 42px);
    font-weight: 800;
    line-height: 1.45;
    text-align: left;
}

/* 説明文：通常の太さで、行間をコンパクトに */
#ai-why > .ae-ai__section-heading > p {
    margin: 0;
    color: var(--ai-ink);
    font-size: 17px;
    font-weight: 400;
    line-height: 1.65;
}

#ai-why > .ae-ai__section-heading > p > span {
    display: block;
}

#ai-why > .ae-ai__section-heading > p > .ae-ai__why-copy-mobile {
    display: none;
}

#ai-why > .ae-ai__section-heading > p > span + span {
    margin-top: 0;
}

.ae-ai__why-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 20px;
    counter-reset: why-card;
}

.ae-ai__why-card {
    min-width: 0;
    padding: 0;
    perspective: 1200px;
    counter-increment: why-card;
    transition: transform 240ms ease;
}

.ae-ai__why-inner {
    display: grid;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 600ms cubic-bezier(0.22, 0.7, 0.25, 1);
}

.ae-ai__why-card.is-flipped .ae-ai__why-inner {
    transform: rotateY(180deg);
}

.ae-ai__why-front,
.ae-ai__why-back {
    position: relative;
    grid-area: 1 / 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 280px;
    border: 1px solid var(--ai-blue);
    border-radius: 8px;
    padding: 28px 28px 64px;
    box-shadow:
        0 3px 6px rgba(8, 11, 32, 0.09),
        0 12px 18px -8px rgba(8, 11, 32, 0.22);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transition: box-shadow 240ms ease;
}

/* 表面：トップと共通の薄青にする */
.ae-ai__why-front {
    justify-content: center;
    background: #f0f6ff;
}

/* 表裏に、透明なプラスチックの縁を重ねる */
.ae-ai__why-back::after {
    content: "";
    position: absolute;
    inset: 1px;
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 6px;
    pointer-events: none;
}

/* 番号：淡すぎない青にする */
.ae-ai__why-front::before {
    content: counter(why-card, decimal-leading-zero);
    position: absolute;
    top: 16px;
    right: 24px;
    color: transparent;
    -webkit-text-stroke: 1px var(--ai-blue);
    font: 800 72px/1 Arial, sans-serif;
    letter-spacing: -0.06em;
    pointer-events: none;
}

/* 裏面：白地と上端の青い帯で表面と区別する */
.ae-ai__why-back {
    display: grid;
    grid-template-rows: minmax(72px, 1fr) minmax(min-content, 2fr);
    row-gap: 20px;
    padding: 24px 28px 28px;
    transform: rotateY(180deg);
    background:
        linear-gradient(
            to bottom,
            var(--ai-blue) 0,
            var(--ai-blue) 5px,
            #fff 5px,
            #fff 100%
        );
}

.ae-ai__why-grid h3 {
    position: relative;
    margin: 16px 0 24px;
    color: var(--ai-blue);
    font-size: clamp(22px, 1.8vw, 25px);
    font-weight: 800;
    line-height: 1.5;
    letter-spacing: 0;
}
.ae-ai__why-grid p {
    margin: 0;
    color: var(--ai-ink);
    font-size: 17px;
    font-weight: 400;
    line-height: 1.75;
}

.ae-ai__why-grid .ae-ai__why-back-title {
    display: flex;
    align-items: center;
    min-width: 0;
    margin: 0;
    border-bottom: 2px dotted #79aeff;
    padding-bottom: 18px;
    color: var(--ai-blue);
    font-size: clamp(22px, 1.8vw, 25px);
    font-weight: 800;
    line-height: 1.5;
}

/* 表裏とも、カード全体を操作できるようにする */
.ae-ai .ae-ai__why-toggle {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin: 0;
    border: 0;
    border-radius: 8px;
    padding: 22px 16px;
    background: transparent;
    color: #53647f;
    font: inherit;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    text-align: center;
    cursor: pointer;
}

.ae-ai__why-hint-pc {
    display: inline;
}

.ae-ai__why-hint-touch {
    display: none;
}

.ae-ai__why-toggle:focus-visible {
    outline: 3px solid #064bfa;
    outline-offset: -6px;
}

@media (hover: none), (pointer: coarse) {
    .ae-ai__why-hint-pc {
        display: none;
    }

    .ae-ai__why-hint-touch {
        display: inline;
    }
}

@media (hover: hover) and (pointer: fine) {
    .ae-ai__why-card:hover {
        transform: translateY(-4px);
    }

.ae-ai__why-card:hover .ae-ai__why-front,
.ae-ai__why-card:hover .ae-ai__why-back {
    box-shadow:
        0 3px 6px rgba(8, 11, 32, 0.07),
        0 14px 22px -7px rgba(30, 64, 130, 0.22);
}
}

@media (prefers-reduced-motion: reduce) {
    .ae-ai__why-card,
    .ae-ai__why-inner,
    .ae-ai__why-front,
    .ae-ai__why-back {
        transition: none;
    }

    .ae-ai__why-card:hover {
        transform: none;
    }
}
