/* =========================================================================
   site.css — 稼ぐ仕事サイト デザインシステム（方向性②「温」）
   - iPhone 12 ラベンダーを主役に、人間味のある温かいダーク/ライト両対応。
   - トークンは :root に定義 → prefers-color-scheme と [data-theme] で切替。
   - コンポーネントは必ずトークン経由で色を参照する（メディアクエリ内で直接色を書かない）。
   ========================================================================= */

/* ---- Tokens: 既定（ライト） ---- */
:root {
    /* ブランド：iPhone 12 ラベンダー */
    --accent: #7f66d0;
    /* ライト地で読める濃さ */
    --accent-strong: #6a4fc4;
    --accent-ink: #ffffff;
    /* アクセント上の文字 */
    --accent-wash: rgba(127, 102, 208, 0.10);
    --accent-line: rgba(127, 102, 208, 0.28);

    /* 地・面・文字 */
    --bg: #f7f4fb;
    --bg-tint: #efeaf6;
    --surface: #ffffff;
    --surface-2: #f3eff8;
    --text: #221d2b;
    --muted: #6c6478;
    --faint: #a49bb2;
    --border: rgba(34, 29, 43, 0.10);
    --shadow: 0 10px 30px rgba(60, 40, 100, 0.10);

    /* かたち */
    --radius: 16px;
    --radius-lg: 26px;
    --radius-pill: 999px;
    --maxw: 1080px;
    --gap: clamp(1rem, 3vw, 2rem);

    /* 文字 */
    --font-display: 'Zen Maru Gothic', 'Zen Kaku Gothic New', sans-serif;
    --font-body: 'Zen Kaku Gothic New', sans-serif;
    --font-label: 'Raleway', sans-serif;
    --font-en: 'Cormorant Garamond', serif;

    color-scheme: light dark;
}

/* ---- Tokens: ダーク（OS設定） ---- */
@media (prefers-color-scheme: dark) {
    :root {
        --accent: #c9b6ec;
        --accent-strong: #cdb4f0;
        --accent-ink: #1a1220;
        --accent-wash: rgba(205, 180, 240, 0.12);
        --accent-line: rgba(205, 180, 240, 0.26);

        --bg: #0e0a11;
        --bg-tint: #140e19;
        --surface: #17111e;
        --surface-2: #1e1727;
        --text: #f2ede9;
        --muted: #b0a4ad;
        --faint: #6f6577;
        --border: rgba(255, 255, 255, 0.09);
        --shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
    }
}

/* ---- Tokens: トグルによる明示指定（メディアクエリに勝つ） ---- */
:root[data-theme="light"] {
    --accent: #7f66d0; --accent-strong: #6a4fc4; --accent-ink: #ffffff;
    --accent-wash: rgba(127, 102, 208, 0.10); --accent-line: rgba(127, 102, 208, 0.28);
    --bg: #f7f4fb; --bg-tint: #efeaf6; --surface: #ffffff; --surface-2: #f3eff8;
    --text: #221d2b; --muted: #6c6478; --faint: #a49bb2;
    --border: rgba(34, 29, 43, 0.10); --shadow: 0 10px 30px rgba(60, 40, 100, 0.10);
}
:root[data-theme="dark"] {
    --accent: #c9b6ec; --accent-strong: #cdb4f0; --accent-ink: #1a1220;
    --accent-wash: rgba(205, 180, 240, 0.12); --accent-line: rgba(205, 180, 240, 0.26);
    --bg: #0e0a11; --bg-tint: #140e19; --surface: #17111e; --surface-2: #1e1727;
    --text: #f2ede9; --muted: #b0a4ad; --faint: #6f6577;
    --border: rgba(255, 255, 255, 0.09); --shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}

/* ---- Reset / base ---- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
    font-family: var(--font-body);
    font-weight: 300;
    line-height: 1.85;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
    transition: background-color .3s ease, color .3s ease;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

/* やわらかな背景の光（人間味） */
body::before {
    content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background: radial-gradient(80% 60% at 12% -5%, var(--accent-wash), transparent 60%);
}

/* ---- Layout ---- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(20px, 5vw, 40px); }
.section { padding: clamp(56px, 10vw, 108px) 0; }
.section-tint { background: var(--bg-tint); }

.eyebrow {
    font-family: var(--font-label); font-size: 12px; font-weight: 500;
    letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent-strong);
    display: inline-flex; align-items: center; gap: 12px; margin-bottom: 18px;
}
.eyebrow::before { content: ''; width: 26px; height: 2px; border-radius: 2px; background: var(--accent); }

.section-title {
    font-family: var(--font-display); font-weight: 500;
    font-size: clamp(1.6rem, 4vw, 2.4rem); line-height: 1.4; letter-spacing: 0.01em;
    text-wrap: balance; color: var(--text); margin-bottom: 14px;
}
.section-lead { color: var(--muted); font-size: clamp(1rem, 1.5vw, 1.1rem); max-width: 42em; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
    font-family: var(--font-body); font-weight: 500; font-size: 1rem; line-height: 1;
    padding: 15px 30px; border-radius: var(--radius-pill); border: 1px solid transparent;
    cursor: pointer; transition: transform .2s ease, box-shadow .2s ease, background-color .2s, color .2s, border-color .2s;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 24px var(--accent-wash); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px var(--accent-line); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-strong); transform: translateY(-2px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.link-arrow { color: var(--accent-strong); text-decoration: none; font-weight: 500; border-bottom: 1px solid var(--accent-line); padding-bottom: 2px; transition: border-color .2s; }
.link-arrow:hover { border-color: var(--accent); }

/* ---- Card ---- */
.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 22px 24px; transition: transform .2s ease, border-color .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-4px); border-color: var(--accent-line); box-shadow: var(--shadow); }
.card h3 { font-family: var(--font-display); font-weight: 500; font-size: 1.08rem; margin-bottom: 6px; color: var(--text); }
.card p { font-size: 0.9rem; color: var(--muted); line-height: 1.7; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* ---- Badge / status ---- */
.badge {
    display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-label);
    font-size: 12px; font-weight: 500; letter-spacing: 0.04em; color: var(--accent-strong);
    background: var(--accent-wash); border: 1px solid var(--accent-line);
    padding: 5px 12px; border-radius: var(--radius-pill);
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
/* 受注ステータス別の色（js/site-status.js が付与） */
.badge.is-full { color: #b9791f; background: rgba(220, 150, 40, 0.12); border-color: rgba(220, 150, 40, 0.4); }
.badge.is-full .dot { background: #d99630; box-shadow: 0 0 8px #d99630; }
.badge.is-closed { color: var(--muted); background: var(--surface-2); border-color: var(--border); }
.badge.is-closed .dot { background: var(--faint); box-shadow: none; }

/* ---- Top bar / nav ---- */
.topbar {
    position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(14px); border-bottom: 1px solid var(--border);
}
.topbar .inner { display: flex; align-items: center; justify-content: space-between; height: 62px; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-family: var(--font-display); font-weight: 500; letter-spacing: 0.02em; }
.brand img { width: 26px; height: 26px; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav a {
    text-decoration: none; color: var(--muted); font-size: 0.92rem; padding: 8px 13px; border-radius: 10px;
    transition: color .2s, background-color .2s;
}
.nav a:hover, .nav a.active { color: var(--text); background: var(--surface-2); }
.nav a.active { color: var(--accent-strong); }

/* テーマトグル */
.theme-toggle {
    width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border);
    background: var(--surface); color: var(--text); cursor: pointer; display: inline-grid; place-items: center;
    transition: border-color .2s, transform .2s;
}
.theme-toggle:hover { border-color: var(--accent); transform: rotate(15deg); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-toggle svg { width: 18px; height: 18px; }

/* モバイルナビ */
.nav-toggle { display: none; }
@media (max-width: 720px) {
    .nav { position: fixed; inset: 62px 0 auto 0; flex-direction: column; align-items: stretch; gap: 0;
        background: var(--bg); border-bottom: 1px solid var(--border); padding: 8px; transform: translateY(-140%);
        transition: transform .3s ease; }
    .nav.open { transform: translateY(0); }
    .nav a { padding: 14px 16px; font-size: 1rem; }
    .nav-toggle { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--border);
        border-radius: 10px; background: var(--surface); color: var(--text); cursor: pointer; }
}

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--border); padding: 44px 0; color: var(--muted); font-size: 0.86rem; }
.site-footer .inner { display: flex; flex-wrap: wrap; gap: 18px 30px; align-items: center; justify-content: space-between; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent-strong); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }

/* ---- Utilities ---- */
.stack { display: flex; flex-direction: column; }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.tabnum { font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
