/* ea-first-view.css — 最初の画面の飾り (2026-10-20)
 * Miner: 動画の枠 (.eam-hero-media)・「しくみ」「結果の見え方」「Pro」の 3 区画 (#eam-mkt)
 * Builder: ウェルカムの動画の枠 (.eab-hero-media)
 * 色・角は fx-tools-common.css の --sft-* を使う。製品の窓 (.eam-stage・.eab-hero-media) だけは地の明暗によらず暗い窓にする。
 * 動きは prefers-reduced-motion: no-preference の中だけ。動かさない既定の姿が「完成した絵」になるよう、
 * 既定の値 = アニメの最後の状態にしてある。 */

/* ── 動画の枠 ── */
.eam-hero-media, .eab-hero-media {
    position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden;
    border: 1px solid rgba(148, 163, 184, .22); border-radius: 18px; background: #060b18;
    box-shadow: 0 0 0 1px rgba(251, 191, 36, .10), 0 30px 70px -26px rgba(245, 158, 11, .28), 0 24px 60px -30px rgba(2, 6, 23, .8);
}
[data-sft-theme="light"] .eam-hero-media, [data-sft-theme="light"] .eab-hero-media { box-shadow: 0 0 0 1px rgba(15, 23, 42, .10), 0 28px 60px -28px rgba(30, 41, 59, .45); }
.eam-media-poster, .eab-media-poster, .eam-media-video, .eab-media-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.eam-media-video, .eab-media-video { opacity: 0; transition: opacity .6s ease; }
.is-playing > .eam-media-video, .is-playing > .eab-media-video { opacity: 1; }
.is-noposter > .eam-media-poster, .is-noposter > .eab-media-poster { display: none; }

/* 画像も動画も無いときに見える、CSS と SVG だけの製品の窓 */
.eam-stage { position: absolute; inset: 0; display: flex; flex-direction: column; color: #cbd5e1; font-size: 12px;
    background: radial-gradient(80% 90% at 70% 10%, #13203d 0%, #0a1223 55%, #060b18 100%); }
.eam-stage-bar { display: flex; align-items: center; gap: 6px; padding: 11px 14px; border-bottom: 1px solid rgba(148, 163, 184, .14); }
.eam-stage-bar i { width: 9px; height: 9px; border-radius: 50%; background: #243049; }
.eam-stage-title { margin-left: 10px; font-weight: 600; color: #94a3b8; letter-spacing: .02em; }
.eam-stage-n { margin-left: auto; display: inline-flex; align-items: baseline; gap: 6px; color: #94a3b8; }
.eam-stage-n em { font-style: normal; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.eam-stage-n b { min-width: 4ch; text-align: end; font-weight: 700; color: #fbbf24; font-variant-numeric: tabular-nums; }
@property --eam-n { syntax: "<integer>"; inherits: false; initial-value: 2000; }
.eam-n { --eam-n: 2000; counter-reset: eamn var(--eam-n); }
.eam-n::after { content: counter(eamn); }
.eam-stage-plot { position: relative; flex: 1; min-height: 0; margin: 14px 16px 6px;
    background-image: linear-gradient(rgba(148, 163, 184, .08) 1px, transparent 1px), linear-gradient(90deg, rgba(148, 163, 184, .08) 1px, transparent 1px);
    background-size: 100% 25%, 12.5% 100%; }
.eam-stage-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.eam-stage-plot path { fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 0; }
.eam-gl path { stroke: #94a3b8; stroke-width: 1.2; opacity: .2; }
.eam-win { stroke: #fbbf24; stroke-width: 2.6; }
.eam-win-glow { stroke: #f59e0b; stroke-width: 9; opacity: .28; filter: blur(5px); }
.eam-stage-checks { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 14px 14px; }
.eam-ck { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 7px; font-size: 11px; font-weight: 600; color: #a7f3d0;
    background: rgba(16, 185, 129, .12); border: 1px solid rgba(52, 211, 153, .35); border-radius: 999px; white-space: nowrap; }
.eam-ck i { width: 13px; height: 13px; border-radius: 50%; background: #34d399; position: relative; }
.eam-ck i::after { content: ""; position: absolute; left: 4px; top: 2px; width: 3px; height: 6px; border: solid #04130d; border-width: 0 1.6px 1.6px 0; transform: rotate(45deg); }

@media (prefers-reduced-motion: no-preference) {
    .eam-n { animation: eam-count 9s linear infinite; }
    .eam-gl path { animation: eam-ghost 9s ease-in-out infinite backwards; animation-delay: calc(var(--i, 0) * .35s); }
    .eam-gl path:nth-child(1) { --i: 0; } .eam-gl path:nth-child(2) { --i: 1; } .eam-gl path:nth-child(3) { --i: 2; }
    .eam-gl path:nth-child(4) { --i: 3; } .eam-gl path:nth-child(5) { --i: 4; } .eam-gl path:nth-child(6) { --i: 5; }
    .eam-win { animation: eam-win 9s ease-in-out infinite backwards; }
    .eam-win-glow { animation: eam-glow 9s ease-in-out infinite backwards; }
    .eam-ck { animation: eam-pop 9s ease-out infinite backwards; }
    .eam-ck:nth-child(2) { animation-delay: .45s; } .eam-ck:nth-child(3) { animation-delay: .9s; }
}
@keyframes eam-count { 0% { --eam-n: 0; } 58%, 100% { --eam-n: 2000; } }
@keyframes eam-ghost { 0% { stroke-dashoffset: 1; opacity: .5; } 26% { stroke-dashoffset: 0; opacity: .5; } 44% { opacity: .5; } 56%, 93% { stroke-dashoffset: 0; opacity: .2; } 98%, 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes eam-win { 0%, 38% { stroke-dashoffset: 1; opacity: 1; } 62%, 93% { stroke-dashoffset: 0; opacity: 1; } 98%, 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes eam-glow { 0%, 38% { stroke-dashoffset: 1; opacity: .28; } 62%, 93% { stroke-dashoffset: 0; opacity: .28; } 98%, 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes eam-pop { 0%, 62% { opacity: 0; transform: translateY(8px); } 70%, 93% { opacity: 1; transform: none; } 98%, 100% { opacity: 0; transform: none; } }

/* ── 紹介の 3 区画 ── */
.eam-sec { margin: 64px 0 0; }
.eam-eyebrow { margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--sft-primary-text); }
.eam-h2 { margin: 0 0 28px; max-width: 24ch; font-size: clamp(24px, 3vw, 36px); line-height: 1.15; font-weight: 800; letter-spacing: -.025em; text-wrap: balance; }
.eam-sub { margin: 0 0 18px; max-width: 52ch; font-size: 15px; line-height: 1.7; color: var(--sft-text-secondary); }

.eam-step-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.eam-step { position: relative; padding: 14px 14px 22px; background: var(--sft-bg-card); border: 1px solid var(--sft-border); border-radius: 16px; box-shadow: var(--sft-card-shadow); }
.eam-step h3 { margin: 18px 8px 6px; font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.eam-step p { margin: 0 8px; font-size: 14px; line-height: 1.65; color: var(--sft-text-secondary); }
.eam-step-no { position: absolute; top: 24px; left: 24px; display: grid; place-items: center; width: 26px; height: 26px; font-size: 13px; font-weight: 800;
    color: var(--sft-on-primary); background: var(--sft-primary); border-radius: 50%; }
.eam-vis { position: relative; height: 150px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; overflow: hidden;
    background: var(--sft-bg-alt); border: 1px solid var(--sft-border); border-radius: 12px; }
[data-sft-theme="dark"] .eam-vis { background: #0a1122; }
.eam-pill { display: flex; align-items: center; justify-content: space-between; width: 62%; padding: 7px 12px; font-size: 13px; font-weight: 600; color: var(--sft-text);
    background: var(--sft-bg-card); border: 1px solid var(--sft-border); border-radius: 8px; }
.eam-pill::after { content: "\25BE"; margin-left: 12px; font-size: 11px; color: var(--sft-text-muted); }
.eam-pill-on { border-color: var(--sft-primary); box-shadow: 0 0 0 3px rgba(245, 158, 11, .18); }
.eam-vis-mine { display: grid; grid-template-columns: repeat(3, auto); gap: 8px; align-content: center; justify-content: center; }
.eam-blk { padding: 6px 12px; font-size: 12px; font-weight: 700; text-align: center; color: var(--sft-text-secondary); background: var(--sft-bg-card); border: 1px solid var(--sft-border); border-radius: 8px; }
.eam-blk:nth-child(1), .eam-blk:nth-child(5) { color: var(--sft-primary-text); border-color: var(--sft-primary); }
.eam-bar { grid-column: 1 / -1; height: 6px; margin-top: 8px; background: var(--sft-border); border-radius: 99px; overflow: hidden; }
.eam-bar i { display: block; width: 100%; height: 100%; background: linear-gradient(90deg, #f59e0b, #fbbf24); border-radius: 99px; }
.eam-vis-check { align-items: stretch; padding: 0 22px; }
.eam-ckrow { display: flex; align-items: center; gap: 9px; padding: 7px 10px; font-size: 12px; font-weight: 600; color: var(--sft-text); background: var(--sft-bg-card); border: 1px solid var(--sft-border); border-radius: 8px; }
.eam-ckrow i { flex: none; width: 15px; height: 15px; border-radius: 50%; background: var(--sft-success); position: relative; }
.eam-ckrow i::after { content: ""; position: absolute; left: 5px; top: 2.5px; width: 3px; height: 6.5px; border: solid #fff; border-width: 0 1.6px 1.6px 0; transform: rotate(45deg); }
[data-sft-theme="dark"] .eam-ckrow i::after { border-color: #04130d; }
.eam-ckrow-go { color: var(--sft-primary-text); border-color: var(--sft-primary); }
.eam-ckrow-go i { background: var(--sft-primary); }
.eam-ckrow-go i::after { left: 3px; top: 6px; width: 8px; height: 0; border-width: 1.6px 0 0 0; transform: none; border-color: var(--sft-on-primary); }
[data-sft-theme="dark"] .eam-ckrow-go i::after { border-color: var(--sft-on-primary); }
@media (prefers-reduced-motion: no-preference) {
    .eam-pill-on { animation: eam-ring 6s ease-in-out infinite; }
    .eam-pill:nth-child(2) { animation: eam-ring 6s ease-in-out 2s infinite; }
    .eam-pill:nth-child(3) { animation: eam-ring 6s ease-in-out 4s infinite; }
    .eam-blk { animation: eam-lit 4.8s ease-in-out infinite; }
    .eam-blk:nth-child(1) { animation-delay: 0s; } .eam-blk:nth-child(2) { animation-delay: 1.3s; } .eam-blk:nth-child(3) { animation-delay: 2.6s; }
    .eam-blk:nth-child(4) { animation-delay: 3.4s; } .eam-blk:nth-child(5) { animation-delay: .7s; } .eam-blk:nth-child(6) { animation-delay: 2s; }
    .eam-bar i { animation: eam-fill 4.8s ease-in-out infinite; transform-origin: left; }
    .eam-ckrow { animation: eam-row 6s ease-out infinite backwards; }
    .eam-ckrow:nth-child(2) { animation-delay: .5s; } .eam-ckrow:nth-child(3) { animation-delay: 1s; }
}
@keyframes eam-ring { 0%, 100% { border-color: var(--sft-border); box-shadow: none; } 15%, 45% { border-color: var(--sft-primary); box-shadow: 0 0 0 3px rgba(245, 158, 11, .18); } 60% { border-color: var(--sft-border); box-shadow: none; } }
@keyframes eam-lit { 0%, 100% { background: var(--sft-bg-card); transform: none; } 12%, 30% { background: var(--sft-primary-bg); border-color: var(--sft-primary); color: var(--sft-primary-text); transform: translateY(-2px); } 45% { background: var(--sft-bg-card); transform: none; } }
@keyframes eam-fill { 0% { transform: scaleX(0); } 75%, 100% { transform: scaleX(1); } }
@keyframes eam-row { 0%, 10% { opacity: 0; transform: translateX(-8px); } 22%, 88% { opacity: 1; transform: none; } 100% { opacity: 0; } }

/* 結果の見え方 */
.eam-proof { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 56px; align-items: center; }
.eam-proof .eam-h2 { margin-bottom: 14px; }
.eam-ticks { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; font-size: 15px; color: var(--sft-text); }
.eam-ticks li { display: flex; gap: 10px; align-items: baseline; }
.eam-ticks li::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--sft-primary); }
.eam-cards { display: grid; gap: 14px; }
.eam-rc { padding: 16px 18px 18px; background: var(--sft-bg-card); border: 1px solid var(--sft-border); border-radius: 16px; box-shadow: var(--sft-card-shadow); }
.eam-rc-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 10px; font-size: 14px; }
.eam-rc-tag { padding: 2px 9px; font-size: 11px; font-weight: 600; color: var(--sft-text-muted); border: 1px solid var(--sft-border); border-radius: 999px; }
.eam-rc svg { display: block; width: 100%; height: 150px; overflow: visible; }
.eam-rc-bad svg { height: 56px; }
.eam-rc-grid { stroke: var(--sft-border); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-dasharray: 3 4; }
.eam-rc-unseen { fill: rgba(148, 163, 184, .13); }
.eam-rc-line { fill: none; stroke: var(--sft-primary); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 0; }
.eam-rc-line-bad { stroke: var(--sft-text-muted); stroke-dasharray: 5 4; opacity: .8; }
.eam-rc-foot { padding-left: 75%; margin: 4px 0 10px; text-align: center; }
.eam-cap { font-size: 11px; color: var(--sft-text-muted); }
.eam-chiprow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.eam-rchip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; font-size: 12px; font-weight: 600; border-radius: 999px; border: 1px solid; }
.eam-rchip::before { font-weight: 800; }
.eam-rchip-ok { color: var(--sft-success); background: rgba(16, 185, 129, .1); border-color: rgba(16, 185, 129, .4); }
.eam-rchip-ok::before { content: "\2713"; }
.eam-rchip-bad { color: #dc2626; background: rgba(239, 68, 68, .08); border-color: rgba(239, 68, 68, .4); }
[data-sft-theme="dark"] .eam-rchip-bad { color: #f87171; }
.eam-rchip-bad::before { content: "\2715"; }
.eam-rchip-ref { color: var(--sft-text-secondary); background: var(--sft-bg-alt); border-color: var(--sft-border); }
.eam-rchip-ref::before { content: "\2022"; }
.eam-rc-bad { opacity: .88; }
.eam-rc-stars { margin-right: auto; padding-left: 10px; font-size: 15px; letter-spacing: 2px; color: #e8b923; filter: drop-shadow(0 0 4px rgba(232, 185, 35, .55)); }
.eam-rc-ok { border-color: #e8b923; box-shadow: 0 0 0 1px rgba(232, 185, 35, .45), var(--sft-card-shadow); }
@media (prefers-reduced-motion: no-preference) {
    .eam-proof .eam-rc-ok .eam-rc-line { animation: eam-card-draw 7s ease-in-out infinite; }
}
@keyframes eam-card-draw { 0% { stroke-dashoffset: 1; } 50%, 90% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 0; } }

/* Pro */
.eam-prostrip { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 24px; align-items: end; padding: 30px 32px 32px; margin-bottom: 40px;
    background: linear-gradient(135deg, rgba(245, 158, 11, .12), rgba(245, 158, 11, .03) 60%), var(--sft-bg-card);
    border: 1px solid rgba(245, 158, 11, .4); border-radius: 18px; box-shadow: var(--sft-card-shadow); }
.eam-prostrip .eam-h2 { margin-bottom: 8px; max-width: none; }
.eam-pro-list { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 28px; margin: 12px 0 0; padding: 0; list-style: none; }
.eam-pro-list li { display: grid; gap: 4px; }
.eam-pro-list b { font-size: 15px; }
.eam-pro-list span { font-size: 14px; line-height: 1.6; color: var(--sft-text-secondary); }
.eam-pro-cta { text-decoration: none; padding: 10px 20px; font-size: 14px; font-weight: 700; white-space: nowrap; }

/* 結果が出た後・Pro では紹介を畳む (Pro には Pro の帯も要らない) */
.eam-has-results .eam-steps, .eam-has-results .eam-proof { display: none; }
.eam-has-results .eam-prostrip { margin-top: 28px; }
.eam-is-pro .eam-mkt { display: none; }

@media (max-width: 900px) {
    .eam-sec { margin-top: 48px; }
    .eam-step-list { grid-template-columns: minmax(0, 1fr); }
    .eam-proof { grid-template-columns: minmax(0, 1fr); gap: 28px; }
    .eam-prostrip { grid-template-columns: minmax(0, 1fr); padding: 22px 20px 24px; }
    .eam-pro-list { grid-template-columns: minmax(0, 1fr); }
    .eam-pro-cta { justify-self: start; }
}
@media (max-width: 600px) {
    .eam-stage-checks { padding-bottom: 10px; }
    .eam-ck { font-size: 10px; padding: 4px 8px 4px 6px; }
    .eam-stage-checks .eam-ck:nth-child(3) { display: none; }
}

/* ── Builder のウェルカムの動画枠 ── */
.eab-hero-media { width: min(100%, 640px); margin: 0 0 20px; }
/* 動画の全体を見せる (切らない)。枠は暗い窓で、絵が 16:9 でなくても余白は暗い地になる */
.eab-media-poster, .eab-media-video { object-fit: contain; }
.eab-hero-media .eab-landing-preview { position: absolute; inset: 0; width: auto; margin: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; display: grid; align-items: center; }

/* 2 回目の調整: 番号の丸が中身に被らない・Pro の按内ボタンを見出しの行の右へ */
.eam-vis-check { padding: 0 16px 0 52px; }
.eam-vis-pick .eam-pill { width: 56%; margin-left: 28px; }
.eam-prostrip-copy { grid-column: 1; grid-row: 1; }
.eam-pro-cta { grid-column: 2; grid-row: 1; align-self: center; justify-self: end; }
@media (max-width: 900px) {
    .eam-pro-cta { grid-column: 1; grid-row: auto; justify-self: start; }
}

/* 3 回目の調整 (2026-10-20): 動画の枠を大きく・見出しと縦中央にそろえる / 「しくみ」3 の絵を埋める / Builder のウェルカムでは浮きボタンを隠す */
.eam-hero { grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr); gap: 36px; background: radial-gradient(55% 75% at 76% 50%, rgba(245, 158, 11, .09), transparent 72%); }
.eam-hero-media { align-self: center; }
.eam-vis-check { justify-content: space-evenly; }
.eam-ckrow { gap: 9px; }
.eam-ckrow .eam-spark { flex: none; width: 60px; height: 22px; margin-left: auto; overflow: visible; }
.eam-ckrow .eam-spark path { fill: none; stroke: var(--sft-success); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; opacity: .85; }
.eam-go { margin-left: auto; font-size: 15px; line-height: 1; color: var(--sft-primary-text); }
@media (max-width: 900px) {
    .eam-hero { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
    /* ウェルカムの上では、浮きボタン (パレット・プロパティ) を画面の一番下の角へ寄せて小さくし、動画の中ほどに被らないようにする (押せるまま) */
    body:has(#eab-canvas-hint:not(.eab-hidden)) .eab-mobile-toggle { bottom: calc(6px + env(safe-area-inset-bottom, 0px)); width: 40px; height: 40px; opacity: .92; }
}
