/* =================================================
   なすたか公式サイト v2  スタイル
   デザイン方針: ミニマル・白基調
   ================================================= */

:root {
    --bg: #ffffff;
    --bg-alt: #f6f7f8;
    --text: #1a1a1a;
    --muted: #7a7f87;
    --line: #e6e8eb;
    --accent: #e60012;
    --accent-text: #ffffff;
    /* カード・ボタン背景やヘッダーなど */
    --card: #ffffff;
    --header-bg: rgba(255, 255, 255, 0.85);
    --hero-overlay: rgba(255, 255, 255, 0.6);
    --grid-line: rgba(0, 0, 0, 0.10);
    /* 四角い要素の共通角丸（丸アイコン50%・ピル999pxは対象外） */
    --radius: 5px;
    --max: 860px;
}

/* ダーク配色の中身（OS連動と手動切替で共用） */
@media (prefers-color-scheme: dark) {
    /* 手動でライトを選んでいない限り、OSのダークに追従 */
    :root:not([data-theme="light"]) {
        --bg: #121316;
        --bg-alt: #1a1c20;
        --text: #ececec;
        --muted: #9aa0a8;
        --line: #2a2d33;
        --accent: #e60012;
        --accent-text: #ffffff;
        --card: #1b1e23;
        --header-bg: rgba(18, 19, 22, 0.85);
        --hero-overlay: rgba(18, 19, 22, 0.6);
        --grid-line: rgba(255, 255, 255, 0.10);
    }
}

/* 手動で「ダーク」を選んだとき（OS設定より優先） */
:root[data-theme="dark"] {
    --bg: #121316;
    --bg-alt: #1a1c20;
    --text: #ececec;
    --muted: #9aa0a8;
    --line: #2a2d33;
    --accent: #e60012;
    --accent-text: #ffffff;
    --card: #1b1e23;
    --header-bg: rgba(18, 19, 22, 0.85);
    --hero-overlay: rgba(18, 19, 22, 0.6);
    --grid-line: rgba(255, 255, 255, 0.10);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    color-scheme: light dark;
}

body {
    font-family: "Noto Sans JP", system-ui, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
}

.container {
    width: 100%;
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Header ---------- */
.header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    font-family: "Outfit", sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: 0.08em;
    text-decoration: none;
    color: var(--text);
}

.nav {
    display: flex;
    gap: 28px;
}

.nav a {
    text-decoration: none;
    color: #000;
    font-size: 0.9rem;
    transition: opacity 0.2s;
}

.nav a:hover {
    opacity: 0.6;
}

/* ハンバーガー（スマホ用・初期は非表示） */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 16px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.nav-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--text);
    transition: transform 0.25s, opacity 0.25s;
}

.nav-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Hero ---------- */
.hero {
    /* 色々なデバイスで確実に全画面（下ほど優先。対応ブラウザ／JSがあれば正確な高さに） */
    min-height: 100vh;                      /* 古いブラウザ用フォールバック */
    min-height: 100svh;                     /* モバイルのUIを考慮（対応ブラウザ） */
    min-height: calc(var(--app-vh) * 1px);  /* JSが実ビューポート高さを設定できたとき最優先 */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    padding: 80px 0;
    background-color: var(--bg-alt);
    overflow: hidden; /* 回転した方眼がはみ出さないように */
}

/* 方眼（グリッド）背景：45度回転して右方向へ一定速度でスライド */
.hero::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44'%3E%3Crect width='4' height='4' fill='%23808080' fill-opacity='0.6'/%3E%3C/svg%3E"),
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 44px 44px;
    background-position: -2px -2px, 0 0, 0 0; /* ■を交点の中央に */
    transform: none; /* 回転なし（水平・垂直の方眼） */
    animation: heroGridSlide 2.5s linear infinite;
    pointer-events: none;
    z-index: 0;
}

/* 縦横1マス（44px）ずつ動かす＝進行方向は下45度（右下）、かつシームレスにループ */
@keyframes heroGridSlide {
    from { background-position: -2px -2px, 0 0, 0 0; }
    to   { background-position: 42px 42px, 44px 44px, 44px 44px; }
}

/* ヒーロー背景画像がある場合はグリッドを出さない */
.hero-has-bg::after {
    display: none;
}

/* ヒーローの中身はグリッドより前面に */
.hero .container {
    position: relative;
    z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
    .hero::after {
        animation: none;
    }
}

/* スクロールダウン・インジケーター（下向きシェブロンがフェードしながら降下） */
.scroll-cue {
    position: absolute;
    left: 50%;
    bottom: 32px;
    transform: translateX(-50%) scale(1.1); /* 10%拡大 */
    transform-origin: center bottom;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s;
}

.scroll-cue:hover {
    color: var(--text);
}

/* シェブロンのアニメーション領域 */
.scroll-cue-arrow-box {
    position: relative;
    width: 22px;
    height: 30px;
}

/* アニメーションする下向きシェブロン（中央） */
.scroll-cue-arrow {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    margin: auto;
    width: 18px;
    height: 18px;
    border-bottom: 1.5px solid currentColor;
    border-left: 1.5px solid currentColor;
    animation: scrollChevron 2s infinite;
}

@keyframes scrollChevron {
    0%   { opacity: 0; transform: rotate(-45deg) translate(0, 0); }
    40%  { opacity: 1; }
    80%  { opacity: 0; transform: rotate(-45deg) translate(-18px, 18px); }
    100% { opacity: 0; }
}

/* 矢印の下に横書きの SCROLL */
.scroll-cue-label {
    margin-top: 10px;
    font-family: "Outfit", sans-serif;
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    white-space: nowrap;
}

/* 動きを抑える設定の人にはアニメーションを止め、矢印を静止表示 */
@media (prefers-reduced-motion: reduce) {
    .scroll-cue-arrow {
        animation: none;
        opacity: 1;
        transform: rotate(-45deg);
    }
}

/* ヒーロー背景画像（管理画面で設定されたときだけ付く） */
.hero-has-bg {
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero-has-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--hero-overlay);
    backdrop-filter: blur(1px);
}

.hero-has-bg .container {
    position: relative;
    z-index: 1;
}

.hero-eyebrow {
    font-family: "Outfit", sans-serif;
    text-transform: uppercase;
    text-align: center;
    letter-spacing: 0.25em;
    font-size: 0.75rem;
    color: var(--muted);
    margin-bottom: 20px;
}

.hero-title {
    font-family: "Outfit", sans-serif;
    font-weight: 400;
    font-size: clamp(2.2rem, 14vw, 10rem);
    display: inline-block;
    max-width: 100%;
    line-height: 2.0;
}

.hero-sub {
    color: var(--muted);
    margin: 20px 0 36px;
    font-weight: 300;
}

.btn {
    display: inline-block;
    padding: 12px 32px;
    background: var(--accent);
    color: var(--accent-text);
    text-decoration: none;
    border-radius: 999px;
    font-size: 0.9rem;
    transition: opacity 0.2s;
}

.btn:hover {
    opacity: 0.8;
}

/* ---------- Section ---------- */
.section {
    padding: 88px 0;
}

.section-alt {
    background: var(--bg-alt);
}

/* 横並びレイアウト（Profile｜News、Product｜Social） */
.section.wide .container {
    max-width: 1280px;
}

/* Profile/News 行 と Product/Social 行 の間隔を現在値の50%に（88px→44px ずつ） */
.section.wide:not(.section-alt) {
    padding-bottom: 44px;
}

.section.wide.section-alt {
    padding-top: 44px;
    padding-bottom: 44px; /* フッターとの間隔も同値に */
}

.row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    align-items: stretch; /* カードを等高にして下辺を揃える */
}

/* 片方しか無いとき（例: SNS未設定）は横幅いっぱいに */
.row-2 > .col-block:only-child {
    grid-column: 1 / -1;
}

/* 右カラムを Social（上）＋ Contact（下）の縦積みに */
.col-stack {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* 上下でほぼ等分（Contactを下半分に） */
.col-stack > .col-block {
    flex: 1;
}

/* 各セクションをカード状に（上部にアクセントライン） */
.col-block {
    background: var(--card);
    border: 1px solid var(--line);
    border-top: 3px solid var(--accent);
    border-radius: var(--radius);
    padding: 36px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* ===== セクション内リンクボタンのホバー枠アニメーション =====
   対象: 動画カード / ツールカード(メール含む) / SNSタイル / ニュースカード(本文あり)
   ::before = 左上から top+left、::after = 右下から bottom+right を伸ばして枠を描く */
.card-item,
.tool-item,
.sns-item,
.news-item {
    position: relative;
}

.card-item::before, .card-item::after,
.tool-item::before, .tool-item::after,
.sns-item::before, .sns-item::after,
.news-item::before, .news-item::after {
    content: "";
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
    border: 0 solid var(--accent);
    border-radius: var(--radius);
    transition:
        width 0.55s cubic-bezier(0.22, 1, 0.36, 1),
        height 0.55s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.1s linear;
    z-index: 1;
}

.card-item::before,
.tool-item::before,
.sns-item::before,
.news-item::before {
    top: -1px;
    left: -1px;
    border-top-width: 3px;
    border-left-width: 3px;
}

.card-item::after,
.tool-item::after,
.sns-item::after,
.news-item::after {
    right: -1px;
    bottom: -1px;
    border-bottom-width: 3px;
    border-right-width: 3px;
}

.card-item:hover::before, .card-item:hover::after,
.tool-item:hover::before, .tool-item:hover::after,
.sns-item:hover::before, .sns-item:hover::after,
.news-item:hover::before, .news-item:hover::after {
    width: 100%;
    height: 100%;
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .card-item::before, .card-item::after,
    .tool-item::before, .tool-item::after,
    .sns-item::before, .sns-item::after,
    .news-item::before, .news-item::after {
        transition: opacity 0.1s linear;
    }
}

/* 狭い画面では縦積みに戻す */
@media (max-width: 760px) {
    .row-2 {
        grid-template-columns: 1fr;
        gap: 28px;
    }
}

@media (max-width: 600px) {
    .col-block {
        padding: 24px;
    }
}

.section-title {
    font-family: "Outfit", sans-serif;
    font-weight: 700;
    font-size: 2.4rem;
    letter-spacing: 0.02em;
    margin-bottom: 32px;
    position: relative;
    padding-bottom: 14px;
    text-align: center; /* 中央揃え */
}

.section-title::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%); /* 下線も中央に */
    bottom: 0;
    width: 72px;
    height: 3px;
    background: var(--accent);
}

.lead {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.muted {
    color: var(--muted);
}

.subtitle {
    font-family: "Outfit", sans-serif;
    font-size: 1.1rem;
    margin: 40px 0 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
}

.subtitle:first-of-type {
    margin-top: 8px;
}

/* ---------- Profile（アイコン左・情報右＋項目リスト） ---------- */
.profile {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 上段：アイコン ＋ 名前・紹介 */
.profile-head {
    display: flex;
    gap: 24px;
    align-items: center;
}

.profile-img {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--line);
}

/* 画像未設定時のイニシャル・プレースホルダ */
.profile-img-ph {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: var(--accent-text);
    font-family: "Outfit", sans-serif;
    font-weight: 700;
    font-size: 2.4rem;
    text-transform: uppercase;
    border: none;
    user-select: none;
}

.profile-head-text {
    min-width: 0;
}

.profile-name {
    font-size: 1.6rem;
    margin-bottom: 4px;
}

.profile-activities {
    font-size: 0.95rem;
    line-height: 1.7;
}

/* プロフィール項目（アイコン付き定義リスト） */
.profile-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 4px;
    border-top: 1px solid var(--line);
}

.profile-item {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding-top: 10px;
}

.profile-item dt {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 96px;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.profile-item dt i {
    color: var(--accent);
    width: 1.1em;
    text-align: center;
}

.profile-item dd {
    flex: 1;
    min-width: 0;
    font-size: 0.95rem;
    overflow-wrap: anywhere;
}

/* ---------- News（各項目をカード化・クリックで開閉） ---------- */
.news-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.news-item {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
}

/* カードの見出し部（クリック領域） */
.news-head {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    list-style: none;
}

.news-head::-webkit-details-marker {
    display: none;
}

.news-item .news-head {
    cursor: pointer;
}

.news-date {
    flex: 0 0 auto;
    color: var(--muted);
    font-family: "Outfit", sans-serif;
    font-size: 0.9rem;
}

.news-title {
    flex: 1;
    min-width: 0;
    font-size: 1rem;
    font-weight: 500;
    overflow-wrap: anywhere;
}

/* 新着バッジ（5日以内のニュースに表示） */
.news-new {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 8px;
    font-family: "Outfit", sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    line-height: 1.5;
    color: var(--accent-text);
    background: var(--accent);
    border-radius: 999px;
    vertical-align: middle;
    white-space: nowrap;
}

.news-text {
    color: var(--muted);
    font-size: 0.9rem;
    padding: 2px 20px 18px;
    overflow-wrap: anywhere;
}

/* 開閉シェブロン（本文ありのみ） */
.news-chevron {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: rotate(45deg);
    transition: transform 0.25s;
    margin-bottom: 3px;
}

.news-acc[open] .news-chevron {
    transform: rotate(-135deg);
    margin-bottom: -3px;
}

/* ニュースのページ切り替え（5件ごと） */
.news-pager {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.news-pager button {
    min-width: 36px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--text);
    font-family: "Outfit", sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.news-pager button:hover {
    border-color: var(--accent);
}

.news-pager button.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-text);
}

/* ---------- Product ---------- */
.grid {
    display: grid;
    gap: 24px;
}

.grid-video {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

.card-item {
    display: block;
    text-decoration: none;
    color: var(--text);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
    transition: border-color 0.2s, transform 0.1s;
}


.thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--bg-alt);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 12px;
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thumb .play {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    color: #1a1a1a;
    font-size: 1rem;
    opacity: 0;
    transition: opacity 0.25s;
}

.card-item:hover .thumb .play {
    opacity: 1;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.5;
}

.grid-tool {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.tool-item {
    display: flex;
    gap: 16px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    background: var(--card);
    transition: border-color 0.2s, transform 0.1s;
}


.tool-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-alt);
    border-radius: var(--radius);
    font-size: 1.2rem;
}

.tool-img {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: var(--radius);
}

.tool-body .card-title {
    margin-bottom: 4px;
}

.tool-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--muted);
}

.tool-item:hover .tool-link {
    color: var(--text);
}

/* ---------- Social（正方形タイル）---------- */
.sns {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px;
}

.sns-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    aspect-ratio: 1 / 1;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
    text-decoration: none;
    color: var(--text);
    font-size: 0.85rem;
    text-align: center;
    transition: border-color 0.2s, transform 0.1s;
}


.sns-item i {
    font-size: 2rem;
}

/* ---------- Contact ---------- */
/* Contactカード：内容を中央（上下・左右）に配置 */
.contact-block {
    display: flex;
    flex-direction: column;
}

.contact-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch; /* メールカードを幅いっぱいに（ツールカードと同じ大きさ） */
    justify-content: center;
    gap: 16px;
}

/* メールカードはツールリンク（.tool-item）と同じ意匠・大きさ。折り返しだけ補強 */
.contact-mail .card-title {
    overflow-wrap: anywhere;
}

/* ---------- Footer ---------- */
.footer {
    padding: 22px 0;
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--line);
}

/* フッター末尾の「.」に仕込んだ管理画面への隠しリンク（見た目は普通の文字） */
.secret-link {
    color: inherit;
    text-decoration: none;
    cursor: default;
}

/* © をクリックでライト/ダーク切り替え */
.theme-toggle {
    cursor: pointer;
    user-select: none;
    transition: opacity 0.2s;
}

.theme-toggle:hover {
    opacity: 0.6;
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius);
}

/* ---------- レスポンシブ ---------- */
@media (max-width: 640px) {
    .nav-toggle {
        display: flex;
    }

    .nav {
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--line);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .nav.open {
        max-height: 320px;
    }

    .nav a {
        padding: 14px 24px;
        border-top: 1px solid var(--line);
    }

    .news-item {
        flex-direction: column;
        gap: 4px;
    }

    .profile {
        gap: 16px;
    }

    .profile-head {
        flex-direction: column;
        text-align: center;
        gap: 14px;
    }

    .profile-item {
        flex-direction: column;
        gap: 4px;
    }

    .profile-item dt {
        min-width: 0;
    }

    .hero {
        padding: 100px 0 80px;
    }
}
