/* ------------------------- Reset / Base ------------------------- */
html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Noto Sans JP", sans-serif;
    color: #222;
    line-height: 1.6;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ------------------------- Header ------------------------- */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* ヘッダーロゴのサイズを固定する（←★追加） */
.site-header .logo img {
    height: 40px;
    width: auto;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 24px;
    margin: 0;
    padding: 0;
}

.nav-links a {
    text-decoration: none;
    color: #222;
    font-weight: 600;
    font-size: 0.9rem;
    transition: opacity 0.3s;
}

.nav-links a:hover {
    opacity: 0.6;
}

/* ハンバーガー */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background: #222;
    transition: transform 0.3s, top 0.3s, opacity 0.3s;
}

.menu-toggle.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.menu-toggle.open span:nth-child(2) {
    opacity: 0;
}
.menu-toggle.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ------------------------- Hero ------------------------- */
#hero {
    position: relative;
    width: 100%;
    min-height: clamp(380px, 70vh, 900px);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    overflow: hidden;
}

/* ───── A) 白い覆い ─────
   0.5 秒待機 → 1.2 秒かけて右へスライド */
#hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: #fff;
    z-index: 2;
    animation: heroMask 1.2s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
    animation-delay: 0.5s;
}
@keyframes heroMask {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(100%);
    }
}

/* 背景動画 ─ 最背面 */
.hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: -1;
    filter: brightness(60%);
}

/* テキスト＋ロゴのブロック */
.hero-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.6rem;
    padding-inline: 5%;
    position: relative;
}

/* ロゴ画像 ─ ずっと表示 / 覆いより前面 */
.hero-inner img {
    width: clamp(120px, 22vw, 260px);
    height: auto;
    max-height: 35vh;
    position: relative;
    z-index: 3;
}

/* 見出し・本文 ------------- */
.hero-title,
.subcopy {
    opacity: 0;
    transform: translateY(20px);
}

.hero-title {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.3;
    font-weight: 700;
    animation: fadeUp 0.8s ease-out forwards;
    animation-delay: 0.5s;
}
.subcopy {
    font-size: 0.95rem;
    line-height: 1.5;
    font-weight: 700;
    animation: fadeUp 0.8s ease-out forwards;
    animation-delay: 0.8s;
}

/* ▼ フェードアップ共通キーフレーム ▼ */
@keyframes fadeUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- スマホ専用 ---------- */
@media (max-width: 767px) {
    #hero {
        min-height: clamp(320px, 60vh, 600px);
    }
    .hero-inner {
        gap: 1rem;
    }
    .hero-inner img {
        width: clamp(90px, 40vw, 180px);
    }
}

/* ------------------------- Section Titles ------------------------- */
section h2 {
    font-size: 2rem;
    font-weight: 800;
    margin: 0 0 24px;
    letter-spacing: 0.05em;
}

section h2 .dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: rgb(37, 56, 100);
    border-radius: 50%;
    margin-left: 8px;
}

/* ------------------------- Helpers ------------------------- */
.inner {
    width: min(1200px, 90%);
    margin: 0 auto;
}

/* ------------------------- NEWS ------------------------- */
.news {
    padding: 80px 0;
}

/* === リスト基本レイアウト === */
.news-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.news-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.news-item:last-child {
    border-bottom: none;
}

.news-item .date {
    flex-shrink: 0;
    width: 90px;
    color: #666;
    font-size: 0.85rem;
}
.news-item .label {
    color: rgb(37, 56, 100);
    font-weight: 700;
    font-size: 0.8rem;
}
.news-item .title {
    font-size: 0.9rem;
}

/* === フェードイン (30 % で発火) ============================ */
.news h2,
.news .news-item {
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.news.revealed h2 {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0s;
}

.news.revealed .news-item {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.15s;
}

/* ------------------------- MAGAZINE ------------------------- */
.magazine {
    position: relative;
    padding: 80px 0;
    background: #fafafa;
    overflow: hidden;
}

/* 覆い (A) ─ 2 s で右→左にスライド退場 */
.magazine::before {
    content: "";
    position: absolute;
    inset: 0;
    background: #fafafa;
    transform: translateX(0);
    transition: transform 2s cubic-bezier(0.25, 0.8, 0.25, 1);
    pointer-events: none;
}
.magazine.revealed::before {
    transform: translateX(100%);
}

/* h2 ─ 上半分=初期色 / 下半分=最終色 → 背景を下へスライド */
.magazine h2 {
    --init: rgb(31, 87, 215);
    --final: #222;
    background: linear-gradient(
        to top,
        var(--final) 0 50%,
        var(--init) 50% 100%
    );
    background-size: 100% 200%;
    background-position: 0 0;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    transition: background-position 2s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.magazine.revealed h2 {
    background-position: 0 100%;
}

/* GRID & CARD ------------------------------------------------ */
.card-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(4, 1fr); /* PC 初期値 4 列 */
}

.card {
    overflow: hidden;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s;
}
.card:hover {
    transform: translateY(-4px);
}
.card img {
    aspect-ratio: 16/9;
    object-fit: cover;
}
.card h3 {
    margin: 16px 16px 8px;
    font-size: 1rem;
}
.card p {
    margin: 16px 16px 16px;
    font-size: 0.8rem;
    color: #555;
}

a.card-link {
    color: inherit;
    text-decoration: none;
}
a.card-link:hover,
a.card-link:focus {
    color: inherit;
    text-decoration: none;
}

/* ====== 可変カラム＋スマホ横並び ====== */
/* ─── PC 幅 1280px 以上：4 列 ─── */
@media (min-width: 1280px) {
    .card-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ─── 992–1279px：3 列 ─── */
@media (max-width: 1279px) and (min-width: 992px) {
    .card-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ─── 640–991px：2 列 ─── */
@media (max-width: 991px) and (min-width: 640px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ─── スマホ (≲639px)：1 列＋横並び ─── */
@media (max-width: 639px) {
    /* 1列レイアウトにする ―― 1枚ずつ縦積み */
    .card-grid {
        grid-template-columns: 1fr; /* 1列 */
        gap: 20px; /* カード間余白 */
    }

    /* ── 横並びカード本体 ── */
    .card {
        display: flex; /* 横並び */
        gap: 12px; /* 画像とテキストの間 */
        padding: 12px;
        border-radius: 12px;
        align-items: flex-start; /* テキストを上端そろえ */
    }

    /* ① 画像ブロック：幅固定 96px、高さも 96px に揃えて正方形サムネ */
    .card picture,
    .card img {
        flex: 0 0 96px; /* grow=0, shrink=0, basis=96px → 固定幅 */
        width: 96px;
        height: 96px;
        border-radius: 8px;
        object-fit: cover;
    }

    /* ② ラベル（章題など）を上段に表示する */
    .card p.pt-1 {
        margin: 0 0 4px;
        font-size: 0.8rem;
        line-height: 1.3;
    }

    /* ③ タイトル <h3>：下段、余白調整 */
    .card h3 {
        margin: 0;
        font-size: 0.95rem;
        line-height: 1.35;
    }

    /* ④ picture + テキストをまとめて縦並びにするためのラッパーが無い場合
    　flex-row では p と h3 が横並びになってしまうので、両方を縦積みにする */
    .card p.pt-1,
    .card h3 {
        display: block; /* 縦方向に積まれる */
    }
}

/* ========= SERVICE ========= */

/* --- カード一覧コンテナ ------------------------------------ */
/* 既定：デスクトップ（3列） */
.products .product-cards {
    display: grid;
    gap: 24px;
    padding: 32px 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* タブレット：2列 */
@media (max-width: 1024px) {
    .products .product-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* スマホ：1列 */
@media (max-width: 640px) {
    .products .product-cards {
        grid-template-columns: 1fr;
    }
}

/* --- カード本体（縦型：画像→テキスト） -------------------- */
.products .product-card {
    position: relative; /* 影の重なり対策 */
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);

    /* リフト演出の土台 */
    transform: translateY(0) translateZ(0);
    backface-visibility: hidden;
    will-change: transform, box-shadow;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1),
        box-shadow 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ★ここがホバー：少し上に移動（-4px）＋影を強調 */
.products .product-card:hover,
.products .product-card:has(.card-link:hover) {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
    z-index: 1; /* 近傍カードより上に */
}

/* キーボード操作（Tab フォーカス）でも同じ演出 */
.products .product-card:focus-within {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

/* カード全体リンク想定：フォーカス枠を明確化 */
.products .product-card .card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    text-decoration: none;
}
.products .product-card .card-link:focus-visible {
    outline: 2px solid #1d6494;
    outline-offset: 3px;
    border-radius: 12px;
}

/* 低モーション設定ではアニメ抑制 */
@media (prefers-reduced-motion: reduce) {
    .products .product-card {
        transition: none;
    }
}

/* 画像 */
.products .product-card picture,
.products .product-card img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

/* --- テキストラッパー ------------------------------------ */
.products .product-card .card-body {
    display: flex;
    flex-direction: column; /* h3 → p */
    gap: 0.8rem;
    padding: 16px 16px 18px;
    align-items: flex-start;
    text-align: start;
}

/* 見出し */
.products .product-card h3 {
    margin: 0;
    font-size: clamp(1.05rem, 0.9rem + 0.5vw, 1.3rem);
    line-height: 1.35;
}

/* 本文 */
.products .product-card p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.7;
    color: #555;
}

/* 余白ユーティリティ */
.pb-3 {
    padding-bottom: 2rem;
}

/* ============================================================= */
/*  INNOVATION  ── MAGAZINE と同じ演出                           */
/* ============================================================= */
.innovation {
    position: relative;
    padding: 80px 0;
    background: #fafafa;
    overflow: hidden;
}

/* 覆い (A) ─ 2 s で右→左にスライド退場 */
.innovation::before {
    content: "";
    position: absolute;
    inset: 0;
    background: #fafafa;
    transform: translateX(0);
    transition: transform 2s cubic-bezier(0.25, 0.8, 0.25, 1);
    pointer-events: none;
}
.innovation.revealed::before {
    transform: translateX(100%);
}

/* h2 ─ 同じワイプ効果（色は任意に変更可） */
.innovation h2 {
    --init: rgb(31, 87, 215);
    --final: #222;
    background: linear-gradient(
        to top,
        var(--final) 0 50%,
        var(--init) 50% 100%
    );
    background-size: 100% 200%;
    background-position: 0 0;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    transition: background-position 2s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.innovation.revealed h2 {
    background-position: 0 100%;
}

/* GRID & ITEM */
.innovation-grid {
    display: grid;
    gap: 32px;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}
.innovation-item {
    overflow: hidden;
    border-radius: 12px;
}
.innovation-item img {
    aspect-ratio: 16/9;
    object-fit: cover;
}
.innovation-item h3 {
    margin: 16px;
}
.innovation-item p {
    margin: 0 16px 24px;
    font-size: 0.85rem;
}

/* ============================================================= */
/*  GLOBAL HELPER                                                */
/* ============================================================= */

/* 全セクション共通の横幅＆左右マージンを決めるユーティリティ */
.inner {
    width: min(1200px, 90%);
    margin: 0 auto;
}

/* ============================================================= */
/*  PRODUCTS / SERVICES SECTION                                  */
/* ============================================================= */

.products {
    position: relative;
    background: #fff;
}

/* ---------- HERO --------------------------------------------- */
.products-hero {
    position: relative;
    overflow: hidden;
    color: #fff; /* 文字を白で固定 */
}
.products-hero::before {
    /* 白い覆いスライド */
    content: "";
    position: absolute;
    inset: 0;
    background: #fff;
    transition: transform 1.6s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 2;
}
.products.revealed .products-hero::before {
    transform: translateX(-100%);
}

/* 背景画像 */
.products-hero img {
    width: 100%;
    height: 480px;
    object-fit: cover;
    filter: brightness(60%);
}

/* ---------- 見出し＋コピー（1つの .inner ボックス） --------- */
.hero-text {
    position: absolute;
    top: 50%; /* 画面中央付近 */
    left: 0;
    right: 0; /* ← .inner が中央に来る */
    transform: translateY(-60%); /* 縦位置はお好みで */
    text-align: left;
    color: #fff;
}
.hero-text h2 {
    margin: 0 0 1rem;
    font-size: 2.4rem;
    line-height: 1.2;
}
.hero-text p {
    margin: 0 0 0.8em;
    font-size: 1rem;
    line-height: 1.7;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.hero-text.visible p {
    /* JS で visible が付くとフェード */
    opacity: 1;
    transform: translateY(0);
}

/* ---------- CARDS -------------------------------------------- */
.product-cards {
    display: grid;
    gap: 40px;
    padding: 30px 0;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.product-card {
    text-align: center;
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.products.cards-visible .product-card {
    opacity: 1;
    transform: translateY(0);
}
.product-card img {
    width: 100%;
    aspect-ratio: 1.6/1;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 16px;
}
.product-card h3 {
    margin: 0 0 8px;
    font-size: 1.1rem;
}

/* ---------- 追加で小さなノートが必要な場合 ------------------- */
.product-note {
    background: #fff;
    border: 2px solid #eee;
    border-radius: 8px;
    padding: 24px 18px;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* ------------------------- COMPANY ------------------------- */
.company {
    padding: 80px 0;
}

/* === グリッド基本レイアウト === */
.company-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* 各カード */
.company-card {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    transition: transform 0.3s;
}
.company-card:hover {
    transform: translateY(-4px);
}
.company-card img {
    aspect-ratio: 16/9;
    object-fit: cover;
}
.company-card h3 {
    margin: 16px;
    font-size: 1rem;
}

/* === フェードイン ========================= */
.company h2,
.company .company-card {
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.company.revealed h2 {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0s;
}
.company.revealed .company-card {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.15s;
}

/* ------------------------- Footer ------------------------- */
.site-footer {
    background: #fff;
    color: #111;
    padding: 40px 20px;
}

.footer-inner {
    text-align: center;
}
.footer-logo {
    width: 140px;
    margin: 0 auto 16px;
}
.copy {
    font-size: 0.75rem;
    color: #000000;
}

/* ------------------------- Responsive – Nav ------------------------- */
@media (max-width: 767px) {
    .menu-toggle {
        display: flex;
    }

    .nav-links {
        position: absolute;
        right: 0;
        top: 60px;
        flex-direction: column;
        width: 200px;
        background: #fff;
        padding: 20px;
        border-left: 1px solid #eee;
        border-bottom: 1px solid #eee;
        display: none;
    }
    .nav-links.open {
        display: flex;
    }
    .nav-links li + li {
        margin-top: 12px;
    }
}

/* ------------------------- Responsive –  Wider Screens ------------------------- */
@media (min-width: 1024px) {
    #hero .catchcopy {
        font-size: 1.5rem;
    }
    #hero .subcopy {
        font-size: 1rem;
    }
    section h2 {
        font-size: 2.6rem;
    }
}

/* ── Back-to-Top：Round, Glass-Gray ───────────────────── */
#back-to-top {
    position: fixed;
    bottom: clamp(16px, 2vw, 32px);
    right: clamp(16px, 2vw, 32px);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(100, 100, 100, 0.55);
    backdrop-filter: blur(4px);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: grid;
    place-items: center;
    cursor: pointer;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
#back-to-top.show {
    opacity: 1;
    visibility: visible;
}
#back-to-top:hover,
#back-to-top:focus-visible {
    transform: translateY(-3px);
}
@media (prefers-reduced-motion: reduce) {
    #back-to-top {
        transition: none;
    }
}

.make-bp {
    padding-bottom: 1rem;
}

.make-alca {
    color: rgb(32, 55, 100);
}

.make-link-black {
    color: #222;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.custom-quote {
    border-left: 4px solid #253864; /* お好みの色 */
    padding-left: 1em;
    margin: 1em 0;
}
