/* ===== 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;
}

/* ===== Grad-Sweep Reveal Effect ===== */
.grad-sweep {
    position: relative;
    overflow: hidden;
}

/* グラデーションのオーバーレイ */
.grad-sweep::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 3;
    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;
}

/* レイヤー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);
    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;
    }
}

/* ===== 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;
}