/* =========================================================
   COTOME 共通ブランド
   クリーム色の紙 × 紺墨の太い見出し × コーラル。マーカー・テープ・ドット紙。
   home / index / purchase / auth-action / 規約類から読み込む。
   ========================================================= */

/* ---------- トークン（ライトが既定。OS設定には追従しない） ---------- */
:root {
    --bg: #fbf6ec;
    --surface: #fffdf8;
    --surface-2: #f8f1e4;
    --surface-3: #f0e7d6;
    --ink: #2b2438;
    --ink-2: #5e5668;
    --ink-3: #6f6779;
    --line: #ebe1d0;
    --line-strong: #d8cbb6;
    --control-line: #8f8373;    /* 入力欄の枠。地の色と3:1以上 */

    --coral: #e5533d;           /* 24px以上の太字見出し専用 */
    --accent: #c2412d;          /* ボタン・リンク・小さい文字 */
    --accent-hover: #a7341f;
    --accent-strong: #a7341f;   /* 淡い色の地に置く小さい赤文字。4.5:1以上 */
    --accent-ink: #ffffff;
    --accent-soft: #fde8e1;
    --accent-line: #f2b9a9;

    --lav: #b9a6e8;
    --lav-soft: #eee8fb;
    --mint: #8fd3be;
    --mint-soft: #e3f5ee;
    --butter: #f7e27a;
    --butter-soft: #fff4c2;
    --pink: #f4a7b9;
    --pink-soft: #fde7ec;
    --marker: rgba(247, 226, 122, 0.75);
    --tape: rgba(247, 226, 122, 0.62);
    --tape-alt: rgba(185, 166, 232, 0.5);

    --success: #2f7a58;
    --success-soft: #e1f3e9;
    --danger: #b3261e;
    --danger-soft: #fbe4e1;
    --focus: rgba(194, 65, 45, 0.3);

    --mat: #f6eee0;
    --dot: rgba(43, 36, 56, 0.1);
    --paper: #ffffff;
    --paper-ink: #22201c;

    --shadow-sm: 0 1px 2px rgba(60, 40, 30, 0.06);
    --shadow-md: 0 1px 2px rgba(60, 40, 30, 0.06), 0 10px 28px -10px rgba(60, 40, 30, 0.2);
    --shadow-card: 0 1px 1px rgba(60, 40, 30, 0.08), 0 14px 34px -12px rgba(60, 40, 30, 0.32);
    --shadow-pop: 0 2px 0 rgba(43, 36, 56, 0.9);

    --font-sans: "Inter", "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
    --font-display: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 18px;
    --radius-xl: 28px;
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

    color-scheme: light;
}

/* 利用者が明示的に選んだときだけの「夜の紙」 */
:root[data-theme="dark"] {
    --bg: #1d1925;
    --surface: #25202f;
    --surface-2: #2c2638;
    --surface-3: #363043;
    --ink: #f5efe5;
    --ink-2: #d2c9d8;
    --ink-3: #aea4b9;
    --line: #3b3448;
    --line-strong: #524861;
    --control-line: #807592;

    --coral: #ff8b72;
    --accent: #f27c63;
    --accent-hover: #f8957f;
    --accent-strong: #f27c63;
    --accent-ink: #24130e;
    --accent-soft: #42272a;
    --accent-line: #7a3f35;

    --lav-soft: #322a47;
    --mint-soft: #1f3631;
    --butter-soft: #3a3322;
    --pink-soft: #3d2530;
    --marker: rgba(247, 226, 122, 0.3);
    --tape: rgba(247, 226, 122, 0.45);
    --tape-alt: rgba(185, 166, 232, 0.4);

    --success: #74c9a0;
    --success-soft: #1b3229;
    --danger: #f39087;
    --danger-soft: #3b1e1c;
    --focus: rgba(242, 124, 99, 0.42);

    --mat: #18141f;
    --dot: rgba(255, 240, 220, 0.08);
    --paper: #f7f4ee;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 28px -10px rgba(0, 0, 0, 0.6);
    --shadow-card: 0 1px 1px rgba(0, 0, 0, 0.5), 0 16px 36px -12px rgba(0, 0, 0, 0.8);
    --shadow-pop: 0 2px 0 rgba(0, 0, 0, 0.6);

    color-scheme: dark;
}

/* ---------- ベース ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: 84px;
}

body {
    margin: 0;
    min-height: 100vh;
    background-color: var(--bg);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.75;
    font-feature-settings: "palt";
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
}

a {
    color: var(--accent);
    text-underline-offset: 3px;
}

a:hover {
    color: var(--accent-hover);
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* JSが hidden で切り替える要素を必ず隠す（外部ログイン等）。上書き禁止。 */
[hidden] {
    display: none !important;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: 12px;
    top: -60px;
    z-index: 100;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    background: var(--ink);
    color: var(--bg);
    text-decoration: none;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 12px;
    color: var(--bg);
}

/* 紙の地：ごく薄いドット */
.paper-dots {
    background-color: var(--bg);
    background-image: radial-gradient(var(--dot) 1px, transparent 1.4px);
    background-size: 22px 22px;
}

/* ---------- ロゴ ---------- */
.brand {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    min-width: 0;
    color: var(--ink);
    text-decoration: none;
}

.brand:hover {
    color: var(--ink);
}

.brand-logo {
    display: block;
    width: 184px;
    height: 54px;
    object-fit: contain;
}

/* 白地の原稿を紙色へなじませる。ロゴの形や文字にはフィルターをかけない。 */
.brand-logo-light { mix-blend-mode: multiply; }
.brand-logo-dark { display: none; border-radius: 8px; }
:root[data-theme="dark"] .brand-logo-light { display: none; }
:root[data-theme="dark"] .brand-logo-dark { display: block; }

.footer-identity { display: grid; gap: 8px; }
.footer-identity p { margin: 0; }
.footer-identity .brand-logo { width: 164px; height: 48px; }

@media (max-width: 600px) {
    .brand-logo { width: 134px; height: 44px; }
    .topbar .brand-logo { width: 120px; }
}

@media (max-width: 360px) {
    .brand-logo { width: 120px; }
    .topbar .brand-logo { width: 100px; }
}

/* 開発環境でだけ app-shell.js が表示する控えめな札 */
.dev-badge {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border: 1px dashed var(--line-strong);
    border-radius: 999px;
    color: var(--ink-3);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

/* ---------- 文字組 ---------- */
.display {
    font-family: var(--font-display);
    font-weight: 900;
    letter-spacing: 0.02em;
    line-height: 1.3;
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--accent-strong);
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.12em;
}

/* 蛍光ペン */
.marker {
    background: linear-gradient(transparent 58%, var(--marker) 58%, var(--marker) 92%, transparent 92%);
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

/* テープ風ラベル */
.tape-label {
    display: inline-block;
    padding: 5px 14px 6px;
    background: var(--tape);
    color: var(--ink);
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    transform: rotate(-1.2deg);
    clip-path: polygon(1% 0, 99% 4%, 100% 96%, 0 100%);
}

/* 夜の紙ではテープを薄くして、明るい文字との差を4.5:1以上にする */
:root[data-theme="dark"] .tape-label {
    background: rgba(247, 226, 122, 0.34);
}

/* 紙を留めるマスキングテープ（親に position:relative が必要） */
.taped::before {
    content: "";
    position: absolute;
    top: -12px;
    left: 50%;
    z-index: 2;
    width: 76px;
    height: 24px;
    background: var(--tape);
    transform: translateX(-50%) rotate(-3deg);
    clip-path: polygon(3% 0, 97% 6%, 100% 94%, 0 100%);
    pointer-events: none;
}

.taped--alt::before {
    background: var(--tape-alt);
    transform: translateX(-50%) rotate(4deg);
}

/* 色付き丸アイコン */
.dot-icon {
    display: inline-grid;
    flex: none;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--pink-soft);
    color: var(--accent);
}

.dot-icon svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dot-icon--lav { background: var(--lav-soft); color: #6a4fc0; }
.dot-icon--mint { background: var(--mint-soft); color: #2b7f66; }
.dot-icon--butter { background: var(--butter-soft); color: #8a6a00; }

:root[data-theme="dark"] .dot-icon--lav { color: var(--lav); }
:root[data-theme="dark"] .dot-icon--mint { color: var(--mint); }
:root[data-theme="dark"] .dot-icon--butter { color: var(--butter); }

/* ---------- ボタン ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border: 1.5px solid transparent;
    border-radius: 999px;
    font-size: 14.5px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.1s;
}

.btn:active:not(:disabled) {
    transform: translateY(1px);
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.btn-primary {
    background: var(--accent);
    color: var(--accent-ink);
    box-shadow: 0 2px 0 rgba(120, 30, 15, 0.35), 0 8px 18px -10px rgba(194, 65, 45, 0.8);
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
    color: var(--accent-ink);
}

.btn-ghost {
    background: var(--surface);
    border-color: var(--line-strong);
    color: var(--ink);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--surface-2);
    border-color: var(--ink-3);
    color: var(--ink);
}

/* 文字だけのボタン（パスワード再設定など） */
.btn-text {
    min-height: 44px;
    padding: 0 6px;
    border: 0;
    background: transparent;
    color: var(--accent);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.btn-text:hover:not(:disabled) {
    color: var(--accent-hover);
}

.btn-lg {
    min-height: 54px;
    padding: 0 28px;
    font-size: 16.5px;
    letter-spacing: 0.04em;
}

.btn-sm {
    min-height: 34px;
    padding: 0 12px;
    gap: 6px;
    font-size: 13px;
}

.btn .icon,
.btn svg {
    flex: none;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.btn-sm .icon {
    width: 15px;
    height: 15px;
}

/* ---------- 文書ページ（購入・認証・規約）共通の枠 ---------- */
.site-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
}

.site-nav-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 18px;
    font-size: 14px;
    font-weight: 600;
}

.site-nav-links a {
    color: var(--ink-2);
    text-decoration: none;
}

.site-nav-links a:hover {
    color: var(--accent);
}

.site-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 24px;
    color: var(--ink-3);
    font-size: 13px;
}

.site-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
}

.site-footer a {
    color: var(--ink-2);
}

/* ---------- 動き ---------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
/* 販売開始前の公開範囲。決済の受付可否はサーバー側で制御する。 */
.availability-notice {
    margin: 0;
    padding: 12px 20px;
    background: #edf7fa;
    color: #2e2a56;
    text-align: center;
    font-size: 14px;
    line-height: 1.7;
}

