@import url("https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@500;600;700&family=Zen+Kaku+Gothic+New:wght@400;500;700;900&display=swap");

:root {
  /* 作品の画像が主役。地は白に近い灰、文字は墨、差し色の朱は番号とリンクの合図だけに使う */
  --bg: #f6f6f4;
  --surface: #ffffff;
  --ink: #131518;
  --ink-2: #41464e;
  --muted: #747a83;
  --line: #e1e2de;
  --accent: #cf452c;
  --font-jp: "Zen Kaku Gothic New", "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif;
  --font-en: "Instrument Sans", "Zen Kaku Gothic New", "Hiragino Sans", sans-serif;
  --container: 1200px;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(19, 21, 24, 0.05), 0 18px 40px -22px rgba(19, 21, 24, 0.28);
  /* 旧ページとの互換用の別名 */
  --paper: var(--surface);
  --panel: #efefec;
  --rule: var(--line);
  --accent-ink: #ffffff;
  --font-mono: var(--font-en);
  --font-display: var(--font-jp);
  --font-body: var(--font-jp);
  --step--1: 0.8125rem; --step-0: 1rem; --step-1: 1.25rem; --step-2: 1.6rem; --step-3: 2.2rem;
  --measure: 44em;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101214; --surface: #181b1e; --ink: #ececea; --ink-2: #c4c7cc; --muted: #8e939a; --line: #2b2f34; --accent: #ff7d60; --panel: #20242a; --accent-ink: #131518;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 18px 40px -22px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #101214; --surface: #181b1e; --ink: #ececea; --ink-2: #c4c7cc; --muted: #8e939a; --line: #2b2f34; --accent: #ff7d60; --panel: #20242a; --accent-ink: #131518;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 18px 40px -22px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-jp); font-size: 16px; line-height: 1.85; letter-spacing: 0.03em; font-weight: 500;  line-break: strict; word-break: keep-all; overflow-wrap: break-word; }
p, li, dd, figcaption { text-wrap: pretty; }
textarea, pre, code, input { word-break: normal; overflow-wrap: break-word; }
h1, h2, h3 { margin: 0; line-height: 1.35; text-wrap: balance; font-weight: 700; letter-spacing: 0.01em; }
img { max-width: 100%; display: block; height: auto; }
a { color: inherit; }
a:focus-visible, button:focus-visible, textarea:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.container, .wrap { width: min(100% - 48px, var(--container)); margin-inline: auto; }
@media (max-width: 560px) { .container, .wrap { width: calc(100% - 32px); } }
.en { font-family: var(--font-en); letter-spacing: 0.02em; }
.muted { color: var(--muted); }
.mono { font-family: var(--font-en); }

/* ヘッダー */
.site-head { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-head .container { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 24px; }
.brand { display: flex; align-items: baseline; gap: 12px; text-decoration: none; }
.brand b { font-size: 17px; font-weight: 700; letter-spacing: 0.08em; }
.brand span { font-family: var(--font-en); font-size: 12px; font-weight: 600; letter-spacing: 0.16em; color: var(--muted); }
.site-nav { display: flex; gap: 28px; font-family: var(--font-en); font-size: 14px; font-weight: 600; }
.site-nav a { text-decoration: none; color: var(--ink-2); }
.site-nav a:hover { color: var(--ink); }
@media (max-width: 560px) { .brand span { display: none; } .site-nav { gap: 18px; } }

/* 見出しの小さな英字ラベル */
.label { font-family: var(--font-en); font-size: 13px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); display: inline-flex; align-items: center; gap: 10px; }
.label::before { content: ""; width: 18px; height: 1.5px; background: var(--accent); }

/* ボタン */
.btn { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 15px; border-radius: 999px; padding: 13px 24px; border: 1.5px solid var(--ink); transition: background 0.2s ease, color 0.2s ease; }
.btn:hover { background: var(--ink); color: var(--bg); }
.btn.solid { background: var(--ink); color: var(--bg); }
.btn.solid:hover { background: transparent; color: var(--ink); }
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }

/* 事例ページ：冒頭 */
.case-head { padding: 64px 0 0; }
.crumb { font-family: var(--font-en); font-size: 13px; font-weight: 600; color: var(--muted); display: flex; gap: 8px; letter-spacing: 0.06em; }
.crumb a { text-decoration: none; }
.crumb a:hover { color: var(--ink); }
.case-head h1, .work-head h1 { font-size: clamp(30px, 4.4vw, 52px); font-weight: 700; letter-spacing: -0.005em; margin: 18px 0 18px; }
.case-head .lead { font-size: 18px; color: var(--ink-2); max-width: 42em; margin: 0; }
.meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 32px; margin: 44px 0 0; padding: 22px 0 0; border-top: 1px solid var(--ink); }
.meta div { min-width: 0; }
.meta dt { font-family: var(--font-en); font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.meta dd { margin: 6px 0 0; font-size: 14.5px; line-height: 1.75; }
@media (max-width: 860px) { .meta { grid-template-columns: 1fr 1fr; gap: 20px 24px; } }
.hero-img { margin: 48px 0 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.case-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* 事例ページ：本文 */
.case-sec, .section { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 32px 56px; padding: 80px 0; border-top: 1px solid var(--line); }
.case-sec:first-of-type { border-top: 0; }
.case-sec > header h2, .section > h2 { font-size: 24px; position: sticky; top: 96px; }
.case-sec > header p { color: var(--muted); font-size: 14px; margin: 10px 0 0; position: sticky; top: 140px; }
.section > h2 { align-self: start; }
.section > *:not(h2) { grid-column: 2; }
@media (max-width: 900px) { .case-sec, .section { grid-template-columns: minmax(0, 1fr); padding: 56px 0; } .case-sec > header h2, .section > h2, .case-sec > header p { position: static; } .section > *:not(h2) { grid-column: 1; } }
.prose { max-width: 44em; }
.prose p { margin: 0 0 1.2em; }
.prose p:last-child { margin-bottom: 0; }
.points { list-style: none; margin: 0; padding: 0; display: grid; gap: 32px; counter-reset: p; }
.points li { counter-increment: p; display: grid; grid-template-columns: 56px 1fr; gap: 4px 16px; }
.points li::before { content: counter(p, decimal-leading-zero); font-family: var(--font-en); font-weight: 600; font-size: 15px; color: var(--accent); padding-top: 2px; }
.points h3 { font-size: 19px; }
.points p { grid-column: 2; margin: 6px 0 0; color: var(--ink-2); }
.figure { margin: 0; }
.figure img { border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.figure figcaption { font-size: 13.5px; color: var(--muted); margin-top: 10px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid-5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 760px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } .grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.note { border-radius: 12px; background: var(--surface); border: 1px solid var(--line); padding: 20px 24px; font-size: 15px; color: var(--ink-2); }
.note b { color: var(--ink); }
.stack { display: grid; gap: 40px; }

/* 表 */
.table-scroll { overflow-x: auto; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
table.ledger { border-collapse: collapse; width: 100%; font-size: 14.5px; min-width: 34rem; overflow-wrap: normal; }
table.ledger th, table.ledger td { text-align: left; vertical-align: top; padding: 14px 18px; border-bottom: 1px solid var(--line); }
table.ledger tr:last-child td { border-bottom: 0; }
table.ledger th { font-size: 12.5px; font-weight: 700; color: var(--muted); letter-spacing: 0.06em; background: color-mix(in srgb, var(--bg) 60%, var(--surface)); white-space: nowrap; }
table.ledger td.num { font-family: var(--font-en); font-variant-numeric: tabular-nums; white-space: nowrap; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; list-style: none; }
.chips li { font-size: 12.5px; border: 1px solid var(--line); border-radius: 999px; padding: 2px 11px; color: var(--ink-2); background: var(--surface); }

/* 次の作品へ */
.next-work { border-top: 1px solid var(--line); padding: 56px 0; display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.next-work a { text-decoration: none; display: grid; gap: 4px; }
.next-work a span { font-family: var(--font-en); font-size: 13px; font-weight: 600; letter-spacing: 0.14em; color: var(--muted); text-transform: uppercase; }
.next-work a b { font-size: 22px; }
.next-work a:hover b { color: var(--accent); }

/* フッター */
.site-foot { border-top: 1px solid var(--line); padding: 32px 0 48px; font-size: 13px; color: var(--muted); }
.site-foot .container, .site-foot .wrap { display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
