/* ikkatsup 公開サイトの style。トークンの値の出典は設計書 §7.1（prototype/assets/ikkatsup.css の :root）。brand の群（記号の色）は §7.1 に無い。 */

/* ───────── tokens ───────── */
:root {
  color-scheme: light dark;

  /* surface / ink : 彩度を持たない中立色。chrome に色相を使わない */
  --c-bg: #f5f6f7;
  --c-surface: #ffffff;
  --c-surface-sunken: #f0f1f3;
  --c-line: #e2e4e8;
  --c-line-strong: #c6cad1;
  --c-ink: #111827; /* ロゴの文字・主ボタン・見出し */
  --c-ink-2: #4b5563; /* 本文の補助 */
  --c-ink-3: #66707d; /* ラベル・注記。白地で 4.5:1 以上 */
  --c-on-ink: #ffffff;
  --c-focus: #1d4ed8;

  /* brand : 記号の 3 段の青緑。-1 は記号の全体、-2 は 2 枚以上が重なる部分、-3 は 3 枚が重なる部分 */
  --c-mark-1: #7fd8cb;
  --c-mark-2: #26a293;
  --c-mark-3: #0b6a62;

  /* state : 色は状態の意味にだけ使う。fg は bg 上で 4.5:1 以上 */
  --s-draft-fg: #86470a;
  --s-draft-bg: #fdf2df;
  --s-draft-dot: #d98200;
  --s-scheduled-fg: #1c4e9d;
  --s-scheduled-bg: #e7effb;
  --s-scheduled-dot: #2f6fdb;
  --s-published-fg: #16633a;
  --s-published-bg: #e3f4ea;
  --s-published-dot: #1f9d55;
  --s-failed-fg: #a1242b;
  --s-failed-bg: #fce9e9;
  --s-failed-dot: #d33a3a;
  --s-canceled-fg: #4b5563;
  --s-canceled-bg: #eceef1;
  --s-canceled-dot: #98a0ab;

  /* type */
  --font-sans:
    ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic UI',
    'Noto Sans JP', Meiryo, system-ui, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  --fs-xs: 0.75rem; /* 12 */
  --fs-sm: 0.8125rem; /* 13 */
  --fs-md: 0.875rem; /* 14 */
  --fs-lg: 1rem; /* 16 : 公開サイトの本文 */
  --fs-xl: 1.25rem; /* 20 */
  --fs-2xl: 1.5rem; /* 24 */
  --lh-tight: 1.35;
  --lh-body: 1.65;

  /* space : 4px 基準 */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4.5rem;

  /* shape : 角丸は 2 段階だけ。影は使わない */
  --r-sm: 4px;
  --r-md: 6px;

  --site-w: 68rem;
  --doc-w: 46rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --c-bg: #0d1117;
    --c-surface: #151b23;
    --c-surface-sunken: #10151c;
    --c-line: #262e39;
    --c-line-strong: #3a4452;
    --c-ink: #e8ecf1;
    --c-ink-2: #aeb6c2;
    --c-ink-3: #8b95a3;
    --c-on-ink: #0d1117;
    --c-focus: #6ea0ff;
    --c-mark-1: #2a8f84;
    --c-mark-2: #4cc7b7;
    --c-mark-3: #b9f1e8;
    --s-draft-fg: #f0b561;
    --s-draft-bg: #2b2112;
    --s-draft-dot: #e39a2b;
    --s-scheduled-fg: #8db4f5;
    --s-scheduled-bg: #172235;
    --s-scheduled-dot: #4f8ce8;
    --s-published-fg: #6fd39a;
    --s-published-bg: #132a1d;
    --s-published-dot: #34b36b;
    --s-failed-fg: #f29a9a;
    --s-failed-bg: #321718;
    --s-failed-dot: #e25a5a;
    --s-canceled-fg: #aeb6c2;
    --s-canceled-bg: #1d2530;
    --s-canceled-dot: #6b7684;
  }
}
:root[data-theme='dark'] {
  --c-bg: #0d1117;
  --c-surface: #151b23;
  --c-surface-sunken: #10151c;
  --c-line: #262e39;
  --c-line-strong: #3a4452;
  --c-ink: #e8ecf1;
  --c-ink-2: #aeb6c2;
  --c-ink-3: #8b95a3;
  --c-on-ink: #0d1117;
  --c-focus: #6ea0ff;
  --c-mark-1: #2a8f84;
  --c-mark-2: #4cc7b7;
  --c-mark-3: #b9f1e8;
  --s-draft-fg: #f0b561;
  --s-draft-bg: #2b2112;
  --s-draft-dot: #e39a2b;
  --s-scheduled-fg: #8db4f5;
  --s-scheduled-bg: #172235;
  --s-scheduled-dot: #4f8ce8;
  --s-published-fg: #6fd39a;
  --s-published-bg: #132a1d;
  --s-published-dot: #34b36b;
  --s-failed-fg: #f29a9a;
  --s-failed-bg: #321718;
  --s-failed-dot: #e25a5a;
  --s-canceled-fg: #aeb6c2;
  --s-canceled-bg: #1d2530;
  --s-canceled-dot: #6b7684;
}

/* ───────── base ───────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  word-break: auto-phrase; /* 非対応の環境では無視される。句の途中で折れる場合は .nb で固める */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--c-bg);
  color: var(--c-ink);
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  font-feature-settings: 'palt' 0;
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure,
blockquote {
  margin: 0;
}
ul,
ol {
  padding: 0;
  list-style: none;
}
h1,
h2,
h3 {
  line-height: var(--lh-tight);
  font-weight: 600;
  letter-spacing: 0;
}
a {
  color: inherit;
  text-decoration-color: var(--c-ink-3);
  text-underline-offset: 0.2em;
}
a:hover {
  text-decoration-color: currentColor;
}
:focus-visible {
  outline: 2px solid var(--c-focus);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
/* ページ内リンクの移動先が画面の端に貼り付かないようにする（header は sticky ではない） */
[id] {
  scroll-margin-top: var(--sp-5);
}
.num,
time {
  font-variant-numeric: tabular-nums;
}
.nb {
  display: inline-block;
}
code {
  padding: 0.1em 0.35em;
  border-radius: var(--r-sm);
  background: var(--c-surface-sunken);
  font-family: var(--font-mono);
  font-size: 0.92em;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}
strong {
  font-weight: 600;
}

/* ───────── wordmark ───────── */
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--c-ink);
  text-decoration: none;
  font-weight: 650;
  font-size: var(--fs-lg);
  letter-spacing: -0.01em;
}
.brand svg {
  width: 1.5rem;
  height: 1.5rem;
  flex: none;
}
.brand-mark-1 {
  fill: var(--c-mark-1);
}
.brand-mark-2 {
  fill: var(--c-mark-2);
}
.brand-mark-3 {
  fill: var(--c-mark-3);
}

/* ───────── site frame（header / main / footer） ───────── */
.site-head {
  border-bottom: 1px solid var(--c-line);
  background: var(--c-surface);
}
.site-head-in {
  max-width: var(--site-w);
  margin: 0 auto;
  padding: var(--sp-3) var(--sp-5);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-5);
}
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--sp-4);
  margin-left: auto;
  font-size: var(--fs-md);
}
.site-nav a {
  padding: var(--sp-1) 0;
  text-decoration: none;
  color: var(--c-ink-2);
}
.site-nav a:hover,
.site-nav a[aria-current='page'] {
  color: var(--c-ink);
}
.site-nav a:hover {
  text-decoration: underline;
}
.site-nav a[aria-current='page'] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.45em;
}
.site-nav .lang {
  color: var(--c-ink);
  font-weight: 600;
}
.site-main {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--site-w);
  margin: 0 auto;
  padding: 0 var(--sp-5);
}
.site-foot {
  border-top: 1px solid var(--c-line);
  background: var(--c-surface);
}
.site-foot-in {
  max-width: var(--site-w);
  margin: 0 auto;
  padding: var(--sp-5);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--sp-4) var(--sp-6);
  font-size: var(--fs-sm);
  color: var(--c-ink-2);
}
.site-foot address {
  font-style: normal;
}
.site-foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1) var(--sp-4);
  align-content: start;
}
.site-foot nav a {
  color: var(--c-ink);
}
.site-foot nav a[aria-current='page'] {
  font-weight: 600;
}

/* 本文中のリンクは色に加えて下線で区別する */
.site-main a:not(.btn) {
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
}

/* ───────── panel（面は 1 段だけ。入れ子にしない） ───────── */
.panel {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
}

/* ───────── button ───────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 2.25rem;
  padding: 0 var(--sp-4);
  border: 1px solid var(--c-line-strong);
  border-radius: var(--r-md);
  background: var(--c-surface);
  color: var(--c-ink);
  font: inherit;
  font-weight: 550;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.btn:hover {
  background: var(--c-surface-sunken);
}
.btn-primary {
  background: var(--c-ink);
  border-color: var(--c-ink);
  color: var(--c-on-ink);
}
.btn-primary:hover {
  background: var(--c-ink);
  opacity: 0.88;
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-3);
}

/* ───────── badge（色 + 点 + 文字。色だけで伝えない） ───────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 1.5rem;
  padding: 0 var(--sp-2);
  border-radius: var(--r-sm);
  font-size: var(--fs-xs);
  font-weight: 600;
  white-space: nowrap;
  background: var(--s-canceled-bg);
  color: var(--s-canceled-fg);
}
.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--s-canceled-dot);
  flex: none;
}
.badge[data-state='draft'] {
  background: var(--s-draft-bg);
  color: var(--s-draft-fg);
}
.badge[data-state='draft']::before {
  background: var(--s-draft-dot);
}
.badge[data-state='scheduled'] {
  background: var(--s-scheduled-bg);
  color: var(--s-scheduled-fg);
}
.badge[data-state='scheduled']::before {
  background: var(--s-scheduled-dot);
}
.badge[data-state='published'] {
  background: var(--s-published-bg);
  color: var(--s-published-fg);
}
.badge[data-state='published']::before {
  background: var(--s-published-dot);
}
.badge[data-state='failed'] {
  background: var(--s-failed-bg);
  color: var(--s-failed-fg);
}
.badge[data-state='failed']::before {
  background: var(--s-failed-dot);
}

/* ───────── table ───────── */
.table-wrap {
  overflow-x: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-md);
  line-height: 1.45;
}
.table th {
  padding: var(--sp-2) var(--sp-4);
  text-align: left;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--c-ink-3);
  background: var(--c-surface-sunken);
  border-bottom: 1px solid var(--c-line);
  white-space: nowrap;
}
.table td,
.table tbody th {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--c-line);
  vertical-align: top;
}
.table tbody th {
  font-size: var(--fs-md);
  color: var(--c-ink);
  background: transparent;
}
.table tr:last-child td,
.table tr:last-child th {
  border-bottom: 0;
}
.table tbody tr:hover {
  background: color-mix(in srgb, var(--c-surface-sunken) 55%, transparent);
}
.table time {
  white-space: nowrap;
}
.cell-title {
  font-weight: 600;
}
.row-attn td:first-child {
  box-shadow: inset 3px 0 0 var(--s-draft-dot);
}
.row-fail td:first-child {
  box-shadow: inset 3px 0 0 var(--s-failed-dot);
}

/* ───────── key-value ───────── */
.kv {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: var(--sp-2) var(--sp-4);
}
.kv dt {
  color: var(--c-ink-3);
  font-size: var(--fs-sm);
  padding-top: 1px;
}
.kv dd {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* ───────── notice ───────── */
.notice {
  display: grid;
  gap: var(--sp-1);
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--c-line-strong);
  border-left-width: 3px;
  border-radius: var(--r-md);
  background: var(--c-surface);
  font-size: var(--fs-md);
}
.notice b {
  font-weight: 600;
}
.notice[data-kind='info'] {
  border-color: var(--s-scheduled-dot);
  background: var(--s-scheduled-bg);
  color: var(--s-scheduled-fg);
}
.notice a {
  text-decoration-color: currentColor;
}

/* ───────── hero / page head ───────── */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: var(--sp-7);
  align-items: center;
  padding: var(--sp-8) 0 var(--sp-7);
}
.hero h1,
.page-head h1 {
  font-size: clamp(1.625rem, 1.1rem + 1.6vw, 2.25rem);
  line-height: 1.3;
  letter-spacing: -0.005em;
  text-wrap: balance;
}
.hero p,
.page-head p {
  margin-top: var(--sp-4);
  color: var(--c-ink-2);
  font-size: var(--fs-lg);
  max-width: 34rem;
}
.hero .btn-row {
  margin-top: var(--sp-5);
}
.hero-figure {
  pointer-events: none;
}
.hero-figure .panel {
  overflow: hidden;
}
.hero-figure figcaption {
  margin-top: var(--sp-2);
  font-size: var(--fs-xs);
  color: var(--c-ink-3);
}
.page-head {
  padding: var(--sp-8) 0 var(--sp-6);
}

/* ───────── band（左に見出し、右に本文） ───────── */
.band {
  border-top: 1px solid var(--c-line);
  padding: var(--sp-7) 0;
  display: grid;
  grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
  gap: var(--sp-4) var(--sp-7);
}
.band > h2 {
  font-size: var(--fs-lg);
}
.band-body {
  display: grid;
  gap: var(--sp-4);
  max-width: 44rem;
  font-size: var(--fs-lg);
}
.band-body p {
  color: var(--c-ink-2);
}
.band-body h3 {
  font-size: var(--fs-lg);
  margin-top: var(--sp-2);
}
.band-body .kv {
  font-size: var(--fs-md);
}
.band-body .contact-mail {
  color: var(--c-ink);
  font-size: var(--fs-xl);
  font-weight: 600;
  overflow-wrap: anywhere;
}
.flow {
  display: grid;
  gap: 0;
  counter-reset: flow;
}
.flow li {
  counter-increment: flow;
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: var(--sp-3);
  padding: var(--sp-4) 0;
  border-top: 1px solid var(--c-line);
}
.flow li:first-child {
  border-top: 0;
  padding-top: 0;
}
.flow li::before {
  content: counter(flow);
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  color: var(--c-ink-3);
}
.flow b {
  display: block;
  font-weight: 600;
  color: var(--c-ink);
}
.flow span {
  color: var(--c-ink-2);
  font-size: var(--fs-md);
}
.prose-list {
  display: grid;
  gap: var(--sp-3);
}
.prose-list li {
  padding-left: 1.1em;
  position: relative;
  color: var(--c-ink-2);
  font-size: var(--fs-md);
}
.prose-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.8em;
  width: 5px;
  height: 1px;
  background: var(--c-ink-3);
}
.prose-list b {
  color: var(--c-ink);
  font-weight: 600;
}

/* ───────── 404 ───────── */
.notfound {
  max-width: 40rem;
  padding: var(--sp-8) 0 var(--sp-7);
  display: grid;
  gap: var(--sp-7);
}
.notfound section {
  display: grid;
  gap: var(--sp-3);
  justify-items: start;
}
.notfound section + section {
  padding-top: var(--sp-6);
  border-top: 1px solid var(--c-line);
}
.notfound h1 {
  font-size: var(--fs-2xl);
}
.notfound section + section h2 {
  font-size: var(--fs-2xl);
}
.notfound p {
  color: var(--c-ink-2);
  font-size: var(--fs-lg);
}

/* ───────── 法的文書（/privacy, /terms）の本文 ───────── */
.doc {
  max-width: var(--doc-w);
  margin: 0 auto;
  padding: var(--sp-7) 0 var(--sp-8);
  font-size: var(--fs-lg);
  overflow-wrap: break-word;
}
.doc h1 {
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  line-height: 1.3;
  text-wrap: balance;
}
.doc-meta {
  margin-top: var(--sp-3);
  color: var(--c-ink-3);
  font-size: var(--fs-sm);
}
.toc {
  margin-top: var(--sp-5);
  padding: var(--sp-4) var(--sp-5);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  background: var(--c-surface);
  font-size: var(--fs-md);
}
.toc::before {
  content: attr(aria-label);
  display: block;
  margin-bottom: var(--sp-2);
  color: var(--c-ink-3);
  font-size: var(--fs-xs);
  font-weight: 600;
}
.doc .toc ol {
  display: grid;
  gap: var(--sp-1);
  padding-left: 1.75em;
  list-style: decimal;
}
.toc li::marker {
  color: var(--c-ink-3);
  font-variant-numeric: tabular-nums;
}
.doc section {
  margin-top: var(--sp-6);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--c-line);
}
.doc .toc + section {
  margin-top: var(--sp-7);
}
.doc section > * + * {
  margin-top: var(--sp-3);
}
.doc section > * + h3 {
  margin-top: var(--sp-5);
}
.doc h2 {
  font-size: var(--fs-xl);
}
.doc h3 {
  font-size: var(--fs-lg);
}
.doc ul,
.doc ol {
  padding-left: 1.5em;
}
.doc ul {
  list-style: disc;
}
.doc ol {
  list-style: decimal;
}
.doc li + li {
  margin-top: var(--sp-1);
}
.doc li > ul,
.doc li > ol {
  margin-top: var(--sp-1);
}
.doc li::marker {
  color: var(--c-ink-3);
}
.doc a {
  overflow-wrap: anywhere;
}
.doc .kv dt {
  overflow-wrap: anywhere;
}
/* Google の開示文などの原文 */
.doc blockquote {
  padding: var(--sp-3) var(--sp-4);
  border-left: 3px solid var(--c-ink);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  background: var(--c-surface);
  font-weight: 500;
}
.doc blockquote p + p {
  margin-top: var(--sp-2);
}
.doc .table-wrap {
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  background: var(--c-surface);
}
.doc .table {
  min-width: 34rem;
}
.doc .table th,
.doc .table td {
  white-space: normal;
  min-width: 7rem;
}

/* ───────── responsive ───────── */
@media (max-width: 960px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    padding: var(--sp-7) 0 var(--sp-6);
    gap: var(--sp-6);
  }
  .page-head {
    padding: var(--sp-7) 0 var(--sp-5);
  }
  .band {
    grid-template-columns: minmax(0, 1fr);
    padding: var(--sp-6) 0;
  }
}
@media (max-width: 760px) {
  .site-head-in {
    padding: var(--sp-3) var(--sp-4);
  }
  .site-nav {
    margin-left: 0;
    width: 100%;
  }
  .site-main {
    padding: 0 var(--sp-4);
  }
  .site-foot-in {
    grid-template-columns: minmax(0, 1fr);
    padding: var(--sp-5) var(--sp-4);
  }
  .kv {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .kv dt {
    margin-top: var(--sp-2);
  }
  .notfound {
    padding: var(--sp-7) 0 var(--sp-6);
  }
  .doc {
    padding: var(--sp-6) 0 var(--sp-7);
  }
  .toc {
    padding: var(--sp-3) var(--sp-4);
  }
  .doc section {
    margin-top: var(--sp-5);
    padding-top: var(--sp-5);
  }
  .doc .toc + section {
    margin-top: var(--sp-6);
  }
}
