/* i-Poster — 全ページ共通の唯一の CSS（v2・2026-09-05）
   正本: docs/DESIGN.md v2（トークンはそこから機械的に起こす。食い違ったら文書が勝つ）
   規則: 影ゼロ・グラデーション無し・UI に有彩色無し・角丸は 10/8/9999 と端末枠だけ・画像の角丸 0（端末枠の中を除く） */

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --paper: #f6f5f4;
  --surface: #ffffff;
  --surface-2: #efedea;
  --hairline: rgba(0,0,0,0.08);
  --hairline-strong: rgba(0,0,0,0.16);
  --ink: #1a1a1a;
  --ink-2: rgba(26,26,26,0.66);
  --ink-3: rgba(26,26,26,0.44);
  --accent: #3a3a3a;
  --accent-hover: #1a1a1a;
  --accent-wash: #eeece9;
  --clock: rgba(255,255,255,0.86);
  --font-latin: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-ja: "Zen Kaku Gothic New", "Hiragino Sans", "Noto Sans JP", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --r-card: 10px;
  --r-btn: 8px;
  --r-pill: 9999px;
  --w-article: 720px;
  --w-list: 1120px;
  --w-gallery: 1280px;
  --gutter: clamp(16px, 3vw, 32px);
  --t: 180ms ease;
  color-scheme: light;
}

/* ── Base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--paper); }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font-ja), var(--font-latin);
  font-size: 17px; line-height: 1.8; letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; color: var(--ink); font-weight: 500; word-break: keep-all; overflow-wrap: anywhere; }
h1 { font-size: 32px; line-height: 1.3; letter-spacing: -0.01em; }
h2 { font-size: 24px; line-height: 1.4; letter-spacing: -0.01em; }
h3 { font-size: 19px; line-height: 1.5; font-weight: 600; letter-spacing: 0; }
.display { font-size: clamp(32px, 4.2vw, 48px); font-weight: 300; line-height: 1.15; letter-spacing: -0.02em; word-break: keep-all; overflow-wrap: anywhere; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0 0 1em; padding-left: 1.4em; }
li { margin: 0.2em 0; }
a { color: inherit; text-decoration: underline; text-decoration-color: var(--ink-3); text-underline-offset: 0.18em; text-decoration-thickness: 1px; transition: text-decoration-color var(--t); }
a:hover { text-decoration-color: var(--accent); }
strong { font-weight: 600; }
em { font-style: normal; font-weight: 500; }
img { max-width: 100%; height: auto; display: block; border-radius: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
code, pre { font-family: var(--font-mono); font-size: 14px; line-height: 1.6; }
.meta { font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.caption { font-size: 13px; line-height: 1.6; letter-spacing: 0.01em; color: var(--ink-3); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; padding: 8px 12px; background: var(--surface); border: 1px solid var(--accent); border-radius: var(--r-btn); }
.skip:focus { left: 8px; }
.wrap { max-width: var(--w-list); margin: 0 auto; padding: 0 var(--gutter); }
.wrap--article { max-width: var(--w-article); }
.wrap--gallery { max-width: var(--w-gallery); }
.num { font-family: var(--font-latin); font-variant-numeric: tabular-nums; }
hr { border: 0; border-top: 1px solid var(--hairline); margin: 48px 0; }

/* ── Header / Nav ───────────────────────────────────────── */
.hd { background: var(--paper); border-bottom: 1px solid var(--hairline); }
.hd__in { max-width: var(--w-gallery); margin: 0 auto; padding: 0 var(--gutter); min-height: 60px; display: flex; align-items: center; gap: 24px; }
.brand { font-family: var(--font-latin); font-weight: 500; font-size: 20px; letter-spacing: -0.01em; text-decoration: none; color: var(--ink); white-space: nowrap; }
.brand small { display: block; font-family: var(--font-ja); font-weight: 400; font-size: 12px; color: var(--ink-3); letter-spacing: 0.01em; line-height: 1.2; margin-top: 2px; }
.nav { margin-left: auto; display: flex; gap: 4px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { display: block; padding: 18px 12px 16px; font-size: 15px; line-height: 1.4; text-decoration: none; color: var(--ink-2); border-bottom: 2px solid transparent; white-space: nowrap; transition: color var(--t), border-color var(--t); }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"], .nav a[aria-current="true"] { color: var(--ink); border-bottom-color: var(--accent); }

/* ── Layout blocks ──────────────────────────────────────── */
.section { padding: 64px 0; }
.section + .section { border-top: 1px solid var(--hairline); }
.section__hd { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.section__hd p { margin: 0; }
.section__hd p a { display: inline-flex; align-items: center; min-height: 28px; }
.hero { padding: 56px 0 40px; }
.hero .display { max-width: 24em; }
.hero__sub { margin-top: 16px; max-width: 40em; color: var(--ink-2); }
.pillars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.pillar { display: block; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-card); padding: 20px; text-decoration: none; transition: background var(--t); }
.pillar:hover { background: var(--accent-wash); }
.pillar h3 { margin-bottom: 6px; }
.pillar p { color: var(--ink-2); font-size: 15px; margin: 0; }
.pillar .more { display: inline-block; margin-top: 10px; font-size: 14px; text-decoration: underline; text-decoration-color: var(--ink-3); text-underline-offset: 0.18em; }
.crumb { font-size: 14px; color: var(--ink-3); margin: 20px 0 0; }
.crumb a { color: var(--ink-2); }
.crumb span { margin: 0 6px; }

/* ── Phone frame（中心部品）───────────────────────────────── */
.phone { position: relative; aspect-ratio: 9 / 19.5; width: 100%; background: var(--surface); border: 1px solid var(--hairline); border-radius: 12.2% / 5.63%; overflow: hidden; } /* 幅の12.2%＝360px 幅で 44px。縦は 12.2/2.1667 で真円 */
.wcard > a.frame, .detail__phone, .pair figure, .article figure { container-type: inline-size; }
.phone img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.phone .clock { position: absolute; left: 0; right: 0; top: 0; height: 32%; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 22%; color: var(--clock); pointer-events: none; font-family: var(--font-latin); font-weight: 300; }
.phone .clock .t { font-size: clamp(18px, 22cqw, 80px); line-height: 1; letter-spacing: -0.02em; }
.phone .clock .d { font-size: clamp(8px, 6.4cqw, 24px); line-height: 1.2; margin-top: 0.3em; font-weight: 400; letter-spacing: 0.01em; }
.phone--guide::after { content: ""; position: absolute; left: 0; right: 0; top: 32%; border-top: 1px dashed var(--clock); }

/* ── Wallpaper card / grid ──────────────────────────────── */
.wgrid { display: grid; gap: 24px 16px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.wgrid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 24px; }
.wgrid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px 20px; }
.wcard { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.wcard > a.frame { display: block; text-decoration: none; }
.wcard .title { font-size: 15px; font-weight: 500; line-height: 1.4; color: var(--ink); margin: 4px 0 0; }
.wcard .title a { text-decoration: underline; text-decoration-color: var(--ink-3); }
.wcard .title a:hover { text-decoration-color: var(--accent); }
.wcard .tool { font-size: 14px; color: var(--ink-2); line-height: 1.6; margin: 0; }
.wcard .acts { display: flex; gap: 4px 14px; flex-wrap: wrap; font-size: 14px; margin: 2px 0 0; }
.wcard .acts a { color: var(--ink-2); display: inline-flex; align-items: center; min-height: 28px; }

/* ── Buttons ────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 18px; border: 1px solid var(--accent); border-radius: var(--r-btn); background: transparent; color: var(--ink); font-size: 15px; font-weight: 500; text-decoration: none; line-height: 1.3; transition: background var(--t), border-color var(--t); }
.btn:hover { background: var(--accent-wash); border-color: var(--accent-hover); }
.btn--block { width: 100%; }
.btn--sm { min-height: 36px; padding: 4px 12px; font-size: 13px; }
.btn .meta { font-weight: 400; color: var(--ink-2); font-size: 13px; }

/* ── Prompt block ───────────────────────────────────────── */
.prompt { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-card); margin: 24px 0; }
.prompt__hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--hairline); font-size: 14px; color: var(--ink-2); }
.prompt pre { margin: 0; padding: 16px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.prompt__ft { padding: 10px 16px; border-top: 1px solid var(--hairline); font-size: 13px; color: var(--ink-2); }
.copy { position: relative; }
.copy[data-done="1"] { background: var(--accent-wash); }

/* ── Notice ─────────────────────────────────────────────── */
.notice { background: var(--surface-2); border-left: 3px solid var(--ink-2); border-radius: var(--r-card); padding: 14px 18px; margin: 24px 0; font-size: 15px; }
.notice p { margin: 0; }
.notice p + p { margin-top: 6px; }

/* ── Tables ─────────────────────────────────────────────── */
.tablewrap { overflow-x: auto; margin: 24px 0; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; background: var(--surface); font-size: 15px; line-height: 1.6; }
th, td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--hairline); }
thead th { font-weight: 500; color: var(--ink-2); font-size: 14px; border-bottom: 1px solid var(--hairline-strong); }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-family: var(--font-latin); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tablewrap table { border: 1px solid var(--hairline); border-radius: var(--r-card); overflow: hidden; }
.tablewrap table thead th:first-child { border-top-left-radius: var(--r-card); }
.src { font-size: 13px; color: var(--ink-3); }

/* ── Article ────────────────────────────────────────────── */
.article { padding: 40px 0 64px; }
.article__hd { margin-bottom: 32px; }
.article__hd h1 { font-size: clamp(28px, 3.4vw, 36px); font-weight: 400; }
.article__hd .meta { margin-top: 12px; }
.article h2 { margin: 48px 0 16px; }
.article h3 { margin: 32px 0 12px; }
.article figure { margin: 24px 0; }
.article figcaption { font-size: 13px; color: var(--ink-3); margin-top: 8px; line-height: 1.6; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin: 24px 0; }
.pair figure { margin: 0; }
.pair .phone { max-width: 260px; margin: 0 auto; }
.pair figcaption { text-align: center; }
.article blockquote { margin: 24px 0; padding: 12px 20px; background: var(--accent-wash); border-radius: var(--r-card); color: var(--ink); font-size: 15px; }
.article blockquote p { margin: 0; }
.article blockquote cite { display: block; margin-top: 6px; font-size: 13px; color: var(--ink-3); font-style: normal; }
.related { border-top: 1px solid var(--hairline); margin-top: 48px; padding-top: 24px; }
.related h2 { font-size: 19px; font-weight: 600; margin: 0 0 12px; }
.related ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.related li a { display: block; padding: 12px 16px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-card); text-decoration: none; transition: background var(--t); }
.related li a:hover { background: var(--accent-wash); }
.related li a span { display: block; font-size: 13px; color: var(--ink-3); }
.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li { position: relative; padding-left: 40px; margin: 0 0 12px; }
.steps li::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 0.2em; width: 26px; height: 26px; border: 1px solid var(--hairline-strong); border-radius: var(--r-pill); font-family: var(--font-latin); font-size: 13px; line-height: 24px; text-align: center; color: var(--ink-2); }

/* ── Wallpaper detail ───────────────────────────────────── */
.detail { display: grid; grid-template-columns: minmax(240px, 360px) minmax(0, 1fr); gap: 48px; padding: 40px 0 64px; align-items: start; }
.detail__phone { position: sticky; top: 24px; }
.detail__body h1 { font-size: clamp(26px, 3vw, 32px); font-weight: 400; }
.detail__body .meta { margin: 8px 0 20px; }
.detail__body .btn { margin-bottom: 8px; }
.detail__body .dl-note { font-size: 13px; color: var(--ink-3); margin: 0 0 24px; }
.detail__body dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 24px; font-size: 15px; }
.detail__body dt { color: var(--ink-2); }
.detail__body dd { margin: 0; }

/* ── Glossary ───────────────────────────────────────────── */
.glist { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.gterm { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-card); padding: 16px 20px; }
.gterm h3 { font-size: 17px; margin: 0; }
.gterm h3 span { font-family: var(--font-latin); font-weight: 400; color: var(--ink-2); font-size: 15px; margin-left: 8px; }
.gterm p { margin: 6px 0 0; font-size: 15px; }
.gterm .snippet { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.gterm code { background: var(--paper); border: 1px solid var(--hairline); border-radius: var(--r-btn); padding: 4px 8px; font-size: 13px; }
.gterm .src { margin-top: 6px; }
.gnav { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 32px; }
.gnav a { display: inline-block; padding: 4px 12px; border: 1px solid var(--hairline-strong); border-radius: var(--r-pill); font-size: 14px; text-decoration: none; color: var(--ink-2); }
.gnav a:hover { background: var(--accent-wash); color: var(--ink); }

/* ── Index lists ────────────────────────────────────────── */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cards--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { display: block; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-card); padding: 20px; text-decoration: none; transition: background var(--t); }
.card:hover { background: var(--accent-wash); }
.card h3 { margin-bottom: 6px; font-weight: 500; }
.card p { color: var(--ink-2); font-size: 15px; margin: 0; }
.card .meta { margin-top: 8px; }
.list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--hairline); }
.list li { border-bottom: 1px solid var(--hairline); }
.list li a { display: flex; justify-content: space-between; gap: 16px; padding: 14px 4px; text-decoration: none; }
.list li a:hover { background: var(--accent-wash); }
.list li a span { color: var(--ink-3); font-size: 14px; white-space: nowrap; }

/* ── Footer ─────────────────────────────────────────────── */
.ft { border-top: 1px solid var(--hairline); margin-top: 64px; padding: 40px 0 32px; font-size: 14px; color: var(--ink-2); }
.ft__in { max-width: var(--w-gallery); margin: 0 auto; padding: 0 var(--gutter); display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.ft__col p { margin: 0 0 8px; }
.ft__col a { display: block; margin: 0 0 6px; }
.ft__bottom { max-width: var(--w-gallery); margin: 24px auto 0; padding: 16px var(--gutter) 0; border-top: 1px solid var(--hairline); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--ink-3); }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1240px) {
  .wgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 20px; }
}
@media (max-width: 1100px) {
  .wgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 20px; }
  .wgrid--4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pillars { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .hd__in { min-height: 52px; flex-wrap: wrap; gap: 0 8px; padding-top: 12px; }
  .brand small { display: none; }
  .nav { margin-left: -6px; width: 100%; overflow-x: auto; overflow-y: hidden; }
  .nav a { display: flex; align-items: center; min-height: 44px; padding: 6px 6px 8px; font-size: 14px; flex: 0 0 auto; }
  .btn--sm { min-height: 44px; }
  .wcard .acts { flex-direction: column; gap: 0; }
  .wcard .acts a { min-height: 44px; }
  .section__hd p a { min-height: 44px; }
  .section { padding: 40px 0; }
  .hero { padding: 32px 0 24px; }
  .wgrid, .wgrid--3, .wgrid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
  .pillars, .cards, .cards--2 { grid-template-columns: 1fr; }
  .detail { grid-template-columns: 1fr; gap: 24px; }
  .detail__phone { position: static; width: min(100%, 300px); margin: 0 auto; } /* max-width + margin:auto + container-type は幅 0 に化ける（v3 実測） */
  .pair { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .ft__in { grid-template-columns: 1fr; gap: 20px; }
  .detail__body dl { grid-template-columns: 1fr; gap: 2px 0; }
  .detail__body dt { font-size: 13px; color: var(--ink-3); margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
