/* ===== Base / Reset ===== */
*, *::before, *::after {
    box-sizing: border-box;
}
html, body {
    height: 100%;
}
body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    letter-spacing: .02em;
    color: #111;
    background: #fff;
}
img {
    max-width: 100%; height: auto; vertical-align: middle;
}
a {
    color: inherit; text-decoration: underline; text-underline-offset: 3px;
}

/* --- デザイン変数の設定 --- */
:root {
    /* グラデーションの色 (ここで自由に変更できます) */
    --acc1: #ff9966;
    --acc2: #ff5e62;
    --acc3: #00F260;
    --acc4: #0575E6;

    /* その他カラー */
    --text: #111;
    --text-on-gray: #fff;
    --gray: #f2f4f8;

    /* アニメーションのタイミング */
    --ease: cubic-bezier(0.7, 0, 0.2, 1);
    --reveal-duration: 800ms; /* オーバーレイのアニメーション時間 */
}

/* ===== Layout ===== */
.container {
    width: min(1100px, 92vw); margin: 0 auto;
}
header.hero {
    position: relative; padding: 64px 0 48px;
}
header .sub {
    opacity: .68; font-weight: 600; margin: .5rem 0 2rem;
}
header .cta {
    display: inline-block; margin-top: 1.25rem; padding: .75rem 1rem; border: 1px solid #ddd;
    border-radius: 12px; text-decoration: none;
}
section {
    padding: 80px 0;
}
section.gray {
    background: var(--gray);
}
.grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px;
}
.card {
    padding: 18px; border-radius: 16px; border: 1px solid #e5e7eb; background: #fff;
    color: var(--text);
}
footer {
    padding: 56px 0; color: #666; border-top: 1px solid #eee;
}

/* ===== New "Whatever-like" Reveal Effect ===== */
.grad-sweep {
    position: relative;
    overflow: hidden; /* はみ出したオーバーレイを隠す */
}

/* グラデーションのオーバーレイ */
.grad-sweep::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 3; /* レイヤーが増えたのでz-indexを調整 */
    background: linear-gradient(90deg, var(--acc1), var(--acc2), var(--acc3), var(--acc4));
    transform: scaleX(0);
    transform-origin: left;
}

/* 表示されるコンテンツの親(h1, h2) */
.grad-sweep > h1,
.grad-sweep > h2 {
    opacity: 0;
    transition: opacity 0.2s linear;
    position: relative; /* ::after の基準になるように */
}

/* レイヤー1: 単色の文字 (最初は透明) */
.grad-sweep h1 > span,
.grad-sweep h2 > span {
    position: relative; /* 重なり順の基準のため */
    color: var(--text);
    opacity: 0;
    transition: opacity 0.4s ease;
}


/* レイヤー2: グラデーションの文字 (最初は不透明) */
.grad-sweep h1::after,
.grad-sweep h2::after {
    content: attr(data-text); /* HTMLのdata-text属性からテキストを取得 */
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(90deg, var(--acc1), var(--acc2), var(--acc3), var(--acc4));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    opacity: 1;
    transition: opacity 0.4s ease;
}


/* is-inviewになった時のアニメーション */
.grad-sweep.is-inview::after {
    /* オーバーレイが左から現れて、右に消えるアニメーション */
    animation: reveal-overlay var(--reveal-duration) var(--ease) forwards;
}

/* コンテンツ全体のフェードイン */
.grad-sweep.is-inview > h1,
.grad-sweep.is-inview > h2 {
    opacity: 1;
    transition-delay: calc(var(--reveal-duration) * 0.4);
}

/* クロスフェードのトリガー */
/* 少し遅れて、単色文字をフェードイン */
.grad-sweep.is-inview h1 > span,
.grad-sweep.is-inview h2 > span {
    opacity: 1;
    transition-delay: calc(var(--reveal-duration) * 0.4 + 500ms);
}
/* 少し遅れて、グラデーション文字をフェードアウト */
.grad-sweep.is-inview h1::after,
.grad-sweep.is-inview h2::after {
    opacity: 0;
    transition-delay: calc(var(--reveal-duration) * 0.4 + 500ms);
}

@keyframes reveal-overlay {
    0% {
        transform: scaleX(0);
        transform-origin: left;
    }
    50% {
        transform: scaleX(1);
        transform-origin: left;
    }
    51% {
        transform-origin: right; /* ここで軸を右に変えるのがポイント */
    }
    100% {
        transform: scaleX(0);
        transform-origin: right;
    }
}

/* ===== Logo x Video Effect (変更なし) ===== */
.logo-stage {
    display: flex; flex-direction: column; gap: 16px;
}
.logo-stack {
    position: relative; display: inline-block; mix-blend-mode: lighten; isolation: isolate;
}
.logo-stack::before {
    content: ""; position: absolute; inset: -0.1em; background: #000; border-radius: .12em; z-index: 0;
}
.logo-mask {
    position: relative; z-index: 1; color: #fff; font-weight: 800; letter-spacing: .02em; line-height: 1;
}
.logo-mask.big {
    font-size: clamp(48px, 12vw, 140px);
}
.logo-video {
    position: absolute; inset: 0; z-index: 2; mix-blend-mode: multiply;
    width: 100%; height: 100%; object-fit: cover;
}

/* ===== General Typography & Helpers ===== */
h1, h2 {
    margin: 0;
}
h1 {
    font-size: clamp(32px, 8vw, 72px);
}
h2 {
    font-size: clamp(22px, 4.6vw, 36px);
}
p {
    margin: .75rem 0 0;
}
.muted {
    color: #6b7280;
}

/* Card hover effect */
.card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}