/* =========================================================
   FREE MIMETICS — site.css（サイト共通）

   すべてのページ（記事・アプリ）で読み込む共通スタイル。
   ここを変えると、全ページのヘッダー・フッター・背景が一度に変わります。

   中身：
     1. 色・サイズの変数
     2. ページの土台と動く背景
     3. サイトヘッダー
     4. サイトフッター
     5. 共通の小物（読み上げ用テキストなど）

   ※ ページごとの見た目（記事本文・アプリ画面）はここに書かない。
   ========================================================= */


/* ================================
   1. 色・サイズの変数
================================= */

:root {
    /* ページの背景（bg.js の残像色もこの値を使う） */
    --bg: #ffffff;

    /* 文字 */
    --fm-text: #172033;
    --fm-text-sub: #667085;

    /* アクセント */
    --fm-accent: #2f6bff;
    --fm-accent-soft: #eef3ff;

    /* 線 */
    --fm-border: #e5e7eb;

    /* ヘッダー・フッター */
    --fm-header-h: 48px;
    --fm-header-bg: rgb(10 19 36 / .96);
    --fm-footer-bg: rgb(17 28 51 / .9);

    /* 共通フォント */
    --fm-font:
        Inter,
        "Noto Sans JP",
        "Hiragino Sans",
        "Yu Gothic UI",
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        sans-serif;
}


/* ================================
   2. ページの土台と動く背景
================================= */

html {
    color-scheme: light;
    background: var(--bg);
}

/* 動く背景（bg.js が作るキャンバス） */
.fm-bg {
    position: fixed;
    inset: 0;
    z-index: -1;

    display: block;
    width: 100%;
    height: 100%;

    pointer-events: none;
}

/*
 * ふつうに縦スクロールするページ（記事など）の土台。
 * アプリ画面（Narwhal tusk など）は自分のCSSで body を決めるので、
 * このクラスは付けない。
 */
.fm-page {
    display: flex;
    flex-direction: column;

    min-height: 100vh;
    margin: 0;

    background: transparent;
    color: var(--fm-text);

    font-family: var(--fm-font);

    -webkit-font-smoothing: antialiased;
}

.fm-page > main {
    flex: 1;
}


/* ================================
   3. サイトヘッダー
   （HTMLは /common/js/site-header.js が出力）
================================= */

.site-header {
    position: relative;
    z-index: 1001;

    display: flex;
    flex-shrink: 0;
    align-items: center;

    gap: 40px;
    height: var(--fm-header-h);
    padding: 0 24px;

    background: var(--fm-header-bg);
    border-bottom: 1px solid rgb(255 255 255 / .09);

    font-family: var(--fm-font);

    backdrop-filter: blur(16px) saturate(1.4);
}

.site-header-logo img {
    display: block;
    height: 26px;
    width: auto;

    filter: brightness(0) invert(1);
}

.site-header nav {
    display: flex;
    gap: 32px;
}

.site-header nav a {
    color: #c3cde0;

    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
}

.site-header nav a:hover,
.site-header nav a[aria-current="page"] {
    color: #f4f7ff;
}

.site-header .page-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    height: 36px;
    margin-left: auto;
    padding: 0 16px;

    background: rgb(255 255 255 / .07);
    border-radius: 999px;

    color: #f4f7ff;

    font-size: 12.5px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.site-header .page-back:hover {
    background: rgb(255 255 255 / .13);
}

@media (max-width: 900px) {
    .site-header {
        gap: 20px;
        padding: 0 16px;
    }
}

@media (max-width: 620px) {
    .site-header {
        gap: 12px;
    }

    .site-header nav {
        display: none;
    }
}


/* ================================
   4. サイトフッター
   （HTMLは /common/js/site-footer.js が出力）
================================= */

.site-footer {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    flex-wrap: wrap;

    gap: 8px 32px;
    padding: 10px 24px;

    background: var(--fm-footer-bg);
    border-top: 1px solid rgb(255 255 255 / .09);

    color: #8f9cb6;

    font-family: var(--fm-font);
    font-size: 12px;
}

.site-footer-logo img {
    display: block;
    height: 20px;
    width: auto;

    filter: brightness(0) invert(1);
}

.site-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 24px;

    color: #d5ddec;
}

.site-footer nav a {
    color: inherit;
    text-decoration: none;
}

.site-footer nav a:hover {
    color: #6b9bff;
}

.site-footer small {
    margin-left: auto;

    font-size: 12px;
    letter-spacing: 0.06em;
}

@media (max-width: 900px) {
    .site-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .site-footer small {
        margin-left: 0;
    }
}


/* ================================
   5. 共通の小物
================================= */

/* 画面には出さず、読み上げ・検索エンジン向けに残すテキスト */
.visually-hidden {
    position: absolute;

    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;

    overflow: hidden;
    clip: rect(0, 0, 0, 0);

    white-space: nowrap;

    border: 0;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
