/* ==================================================
   動きの演出（design.css の後に読み込む）
   JS が html に .js を付けたときだけ有効。動きを減らす設定では無効。
   ================================================== */

/* ---- 画面上端の進捗バー ---- */
.scroll-progress { position: fixed; left: 0; top: 0; height: 3px; width: 100%; z-index: 60; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--blue), #58a6ff 60%, var(--red)); pointer-events: none; }

/* 横からの出現で横スクロールが出ないようにする */
body { overflow-x: clip; }

/* ---- スクロールで現れる ---- */
.js .reveal { opacity: 0; transform: translateY(34px); transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1); transition-delay: var(--d, 0s); will-change: opacity, transform; }
.js .reveal.from-left { transform: translateX(-48px); }
.js .reveal.from-right { transform: translateX(48px); }
.js .reveal.zoom { transform: scale(.94); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---- トップ: ヘッダーを動画に重ねる ---- */
.home .site-header { position: fixed; left: 0; right: 0; transition: background .35s, border-color .35s, box-shadow .35s; }
.home .site-header:not(.is-solid) { background: linear-gradient(180deg, rgba(8,20,38,.55), transparent); border-bottom-color: transparent; backdrop-filter: none; }
.home .site-header:not(.is-solid) .brand img { filter: brightness(0) invert(1); }
.home .site-header:not(.is-solid) .tagline { color: #cfe2f8; }
.home .site-header:not(.is-solid) .gnav > ul > li > a:not(.btn) { color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,.4); }
.home .site-header:not(.is-solid) .gnav > ul > li > a:not(.btn):hover { border-bottom-color: #ffd84a; }
.home .site-header:not(.is-solid) .nav-toggle { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.4); }
.home .site-header:not(.is-solid) .nav-toggle span { background: #fff; }
.home .site-header.is-solid { box-shadow: 0 6px 24px rgba(15,37,64,.1); }
.home .brand img { transition: filter .35s; }

/* ---- トップ: ヒーロー ---- */
.home .hero-video { min-height: min(100vh, 980px); min-height: min(100svh, 980px); }
.home .hero-video .container { padding-top: 150px; will-change: transform, opacity; }
.hero-media .hero-bg.is-active { animation: heroZoom 10s ease-out both; }
@keyframes heroZoom { from { transform: scale(1.08); } to { transform: scale(1); } }
.hero-video::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 64px 64px; mask-image: linear-gradient(90deg, #000 0%, transparent 55%); -webkit-mask-image: linear-gradient(90deg, #000 0%, transparent 55%);
  animation: gridDrift 24s linear infinite; }
@keyframes gridDrift { to { background-position: 64px 64px, 64px 64px; } }
.hero-video > .container, .hero-dots, .hero-toggle, .hero-scroll { z-index: 2; }

.hero h2 .line { display: block; overflow: hidden; padding-bottom: .08em; }
.js .hero h2 .line > span { display: inline-block; transform: translateY(110%); animation: lineUp 1s cubic-bezier(.2,.8,.2,1) forwards; }
.js .hero h2 .line:nth-child(1) > span { animation-delay: .25s; }
.js .hero h2 .line:nth-child(2) > span { animation-delay: .42s; }
@keyframes lineUp { to { transform: none; } }
.hero h2 em { position: relative; }
.js .hero h2 em::after { content: ""; position: absolute; left: .1em; right: .1em; bottom: .02em; height: .12em; background: #ffd84a; opacity: .55; transform: scaleX(0); transform-origin: 0 50%; animation: underline .7s 1.25s cubic-bezier(.2,.8,.2,1) forwards; }
@keyframes underline { to { transform: scaleX(1); } }
.js .hero-eyebrow, .js .hero-lead, .js .hero-actions, .js .hero-tags li { opacity: 0; animation: fadeUp .9s cubic-bezier(.2,.8,.2,1) forwards; }
.js .hero-eyebrow { animation-delay: .1s; }
.js .hero-lead { animation-delay: .75s; }
.js .hero-actions { animation-delay: .95s; }
.js .hero-tags li:nth-child(1) { animation-delay: 1.15s; }
.js .hero-tags li:nth-child(2) { animation-delay: 1.27s; }
.js .hero-tags li:nth-child(3) { animation-delay: 1.39s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
.hero-eyebrow i { display: inline-block; animation: spinX 6s ease-in-out infinite; }
@keyframes spinX { 0%, 80% { transform: rotate(0); } 90%, 100% { transform: rotate(180deg); } }

.btn { position: relative; overflow: hidden; }
.hero-actions .btn::after { content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.55), transparent); transform: skewX(-20deg); animation: shine 4.5s 2s ease-in-out infinite; }
.hero-actions .btn-light::after { background: linear-gradient(100deg, transparent, rgba(31,95,168,.22), transparent); }
@keyframes shine { 0% { left: -60%; } 22%, 100% { left: 130%; } }
.btn .icon { transition: transform .25s; }
.btn:hover .icon:last-child { transform: translateX(4px); }

/* シーンの進み具合が分かる切り替えバー */
.hero-dots { bottom: 96px; gap: 12px; }
.hero-dots button { width: 56px; height: 3px; overflow: hidden; background: rgba(255,255,255,.3); }
.hero-dots button[aria-pressed="true"] { background: rgba(255,255,255,.3); }
.hero-dots button::after { content: ""; position: absolute; inset: 0; background: #ffd84a; transform: scaleX(0); transform-origin: 0 50%; }
.hero-dots button[aria-pressed="true"]::after { animation: dotFill 8s linear forwards; }
.hero-video.is-paused .hero-dots button[aria-pressed="true"]::after { animation-play-state: paused; }
@keyframes dotFill { to { transform: scaleX(1); } }

.hero-scroll { position: absolute; left: 28px; bottom: 96px; display: flex; flex-direction: column; align-items: center; gap: 10px; color: #dbe8f6; font-size: .62rem; letter-spacing: .3em; text-decoration: none; writing-mode: vertical-rl; }
.hero-scroll span { width: 1px; height: 64px; background: rgba(255,255,255,.3); position: relative; overflow: hidden; }
.hero-scroll span::after { content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 40%; background: #ffd84a; animation: scrollLine 2s cubic-bezier(.6,0,.4,1) infinite; }
@keyframes scrollLine { from { transform: translateY(-100%); } to { transform: translateY(260%); } }
.hero-scroll:hover { color: #fff; }
.home .feature-cards { margin-top: -72px !important; }
.home .hero-toggle { bottom: 96px; }

/* ---- 流れる帯 ---- */
.marquee { overflow: hidden; background: var(--navy); color: #fff; padding: 22px 0; position: relative; }
.marquee::before, .marquee::after { content: ""; position: absolute; top: 0; bottom: 0; width: 120px; z-index: 1; pointer-events: none; }
.marquee::before { left: 0; background: linear-gradient(90deg, var(--navy), transparent); }
.marquee::after { right: 0; background: linear-gradient(270deg, var(--navy), transparent); }
.marquee-track { display: flex; width: max-content; animation: marquee 38s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track ul { display: flex; align-items: center; gap: 44px; list-style: none; margin: 0; padding: 0 22px; white-space: nowrap; }
.marquee-track li { font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.5rem, 3.4vw, 2.6rem); letter-spacing: .08em; line-height: 1; }
.marquee-track li:nth-child(odd) { color: transparent; -webkit-text-stroke: 1px rgba(255,255,255,.75); }
.marquee-track li.sep { font-size: 1rem; color: #ffd84a; -webkit-text-stroke: 0; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---- 数字 ---- */
.stats { background: linear-gradient(120deg, var(--navy), #17406f 60%, var(--blue)); color: #fff; padding: 64px 0; position: relative; overflow: hidden; }
.stats::before { content: ""; position: absolute; inset: -40% -10%; background: conic-gradient(from 0deg at 70% 50%, transparent 0 62%, rgba(88,166,255,.22) 70%, transparent 78%); animation: sweep 14s linear infinite; }
@keyframes sweep { to { transform: rotate(360deg); } }
.stats ul { position: relative; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; text-align: center; }
.stats li + li { border-left: 1px solid rgba(255,255,255,.18); }
.stats .num { display: block; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.6rem, 7vw, 4.6rem); line-height: 1.1; font-variant-numeric: tabular-nums; background: linear-gradient(180deg, #fff 30%, #9cc7f7); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stats .num small { font-size: .38em; margin-left: .15em; font-family: inherit; color: #cfe2f8; -webkit-text-fill-color: #cfe2f8; }
.stats .label { display: block; margin-top: 8px; font-size: .9rem; color: #cfe2f8; letter-spacing: .12em; }

/* ---- カードの動き ---- */
.cards .card { transform-style: preserve-3d; }
.tilt { transition: transform .18s ease-out, box-shadow .2s, border-color .2s; }
.card-icon { transition: transform .35s cubic-bezier(.3,1.6,.5,1); }
.card:hover .card-icon { transform: translateY(-4px) rotate(-6deg) scale(1.08); }
.card .more::after { display: inline-block; transition: transform .25s; }
.card:hover .more::after { transform: translateX(6px); }
.section-head h2::after { transform: scaleX(0); transition: transform .8s .3s cubic-bezier(.2,.8,.2,1); }
.js .section-head.is-in h2::after, html:not(.js) .section-head h2::after { transform: scaleX(1); }
.split-img img { transition: transform 1.2s cubic-bezier(.2,.7,.2,1); }
.split-img:hover img { transform: scale(1.03); }
.js .split-img.reveal::before { opacity: 0; transition: opacity .8s .5s, inset .8s .5s; }
.js .split-img.reveal.is-in::before { opacity: .35; }
.section-dark::before { background-attachment: scroll; background-size: auto 150%, cover; background-position: center, center var(--py, 50%); }
.news-list li { position: relative; }
.news-list li::after { content: ""; position: absolute; left: 0; bottom: -1px; height: 1px; width: 0; background: var(--blue); transition: width .5s; }
.news-list li:hover::after { width: 100%; }
.cta h2 { position: relative; }

@media (max-width: 900px) {
  .hero-scroll { display: none; }
  .home .hero-video { min-height: 0; }
  .home .hero-video .container { padding-top: 120px; }
  .home .site-header.is-open { background: #fff; }
  .home .site-header.is-open .brand img { filter: none; }
  .home .site-header.is-open .nav-toggle { background: #fff; border-color: var(--line); }
  .home .site-header.is-open .nav-toggle span { background: var(--navy); }
  .home .site-header:not(.is-solid) .gnav > ul > li > a:not(.btn) { color: var(--ink); text-shadow: none; }
}
@media (max-width: 640px) {
  .stats ul { grid-template-columns: 1fr; gap: 28px; }
  .stats li + li { border-left: 0; border-top: 1px solid rgba(255,255,255,.18); padding-top: 28px; }
  .hero-dots, .home .hero-toggle { bottom: 72px; }
  .home .feature-cards { margin-top: -48px !important; }
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .js .hero h2 .line > span { transform: none; animation: none; }
  .js .hero-eyebrow, .js .hero-lead, .js .hero-actions, .js .hero-tags li { opacity: 1; animation: none; }
  .hero-media .hero-bg.is-active, .hero-video::after, .hero-eyebrow i, .hero-actions .btn::after, .marquee-track, .stats::before, .hero-scroll span::after, .hero-dots button[aria-pressed="true"]::after { animation: none !important; }
  .js .hero h2 em::after { transform: scaleX(1); animation: none; }
  .section-head h2::after { transform: scaleX(1) !important; }
}
