/* LINE スタンプ作成方法 — DESIGN.md 準拠 */
:root {
  --c-bg: #ffffff;            --c-bg-rgb: 255,255,255;
  --c-surface: #f3f7f4;       --c-surface-rgb: 243,247,244;
  --c-line: #dfe7e2;          --c-line-rgb: 223,231,226;
  --c-ink: #1d2721;           --c-ink-rgb: 29,39,33;
  --c-ink-sub: #55625a;       --c-ink-sub-rgb: 85,98,90;
  --c-accent: #06c755;        --c-accent-rgb: 6,199,85;
  --c-accent-ink: #057a37;    --c-accent-ink-rgb: 5,122,55;
  --c-accent-soft: #e6f8ee;   --c-accent-soft-rgb: 230,248,238;
  --c-note: #fff6db;          --c-note-rgb: 255,246,219;
  --c-note-line: #f0d98a;
  --c-code-bg: #1f2a24;       --c-code-ink: #e8f1ec;
  --c-focus: #0b63ce;
  --c-white: #ffffff;

  --f-body: Inter, "Noto Sans JP", system-ui, sans-serif;
  --f-head: "Zen Maru Gothic", "Noto Sans JP", system-ui, sans-serif;
  --f-code: ui-monospace, "SFMono-Regular", Consolas, "Noto Sans JP", monospace;

  --shadow-1: 0 1px 2px rgba(var(--c-ink-rgb), .06);
  --shadow-2: 0 8px 24px rgba(var(--c-ink-rgb), .10);
  --shadow-3: 0 20px 60px rgba(0, 0, 0, .35);

  --r-sm: 8px; --r-md: 10px; --r-lg: 14px;
  --w-content: 760px; --w-toc: 248px; --w-max: 1120px;
  --gutter: 24px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-ink);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.85;
  letter-spacing: .04em;
  line-break: strict;
  word-break: normal;
  overflow-wrap: anywhere;
}
img { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 3px; border-radius: 4px; }

a { color: var(--c-accent-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
a:active { color: var(--c-ink); }

.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--c-ink); color: var(--c-white); padding: 10px 16px; border-radius: var(--r-sm); text-decoration: none; }
.skip-link:focus { top: 12px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(var(--c-bg-rgb), .94); border-bottom: 1px solid var(--c-line); transition: box-shadow .2s ease; }
.site-header.is-scrolled { box-shadow: var(--shadow-1); }
.site-header__inner { max-width: var(--w-max); margin: 0 auto; padding: 0 var(--gutter); min-height: 64px; display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--c-ink); text-decoration: none; font-family: var(--f-head); font-weight: 700; font-size: 17px; letter-spacing: .02em; white-space: nowrap; }
.brand:hover { color: var(--c-accent-ink); }
.brand__mark { width: 30px; height: 30px; color: var(--c-accent); flex: none; }
.site-nav { margin-left: auto; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: var(--r-sm); color: var(--c-ink-sub); text-decoration: none; font-size: 15px; font-weight: 500; white-space: nowrap; transition: background .18s ease, color .18s ease; }
.site-nav a:hover { background: var(--c-surface); color: var(--c-ink); }
.site-nav a[aria-current="page"] { color: var(--c-accent-ink); background: var(--c-accent-soft); }

/* Hero */
.page-hero { background: var(--c-surface); border-bottom: 1px solid var(--c-line); }
.page-hero__inner { max-width: var(--w-max); margin: 0 auto; padding: 48px var(--gutter) 40px; }
/* 下線は見出しの文字幅と同じ長さにする（短い飾り線は使わない）。折り返し時も行ごとに文字幅に一致 */
.page-title { margin: 0; font-family: var(--f-head); font-size: 40px; line-height: 1.6; letter-spacing: -.01em; font-weight: 700;
  text-decoration: underline var(--c-accent) 4px; text-underline-offset: .32em; text-decoration-skip-ink: none; }

.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 0; margin: 0 0 14px; padding: 0; font-size: 14px; color: var(--c-ink-sub); }
.breadcrumb li + li::before { content: "/"; margin: 0 10px; color: var(--c-line); }
.breadcrumb a { color: var(--c-ink-sub); }
.breadcrumb a:hover { color: var(--c-accent-ink); }

/* Layout */
.layout { max-width: var(--w-max); margin: 0 auto; padding: 48px var(--gutter) 24px; display: grid; grid-template-columns: minmax(0, var(--w-content)) var(--w-toc); justify-content: space-between; gap: 56px; }
.content { grid-column: 1; grid-row: 1; min-width: 0; }
.layout > .toc { grid-column: 2; grid-row: 1; }

/* TOC */
.toc details { position: sticky; top: 96px; border-left: 2px solid var(--c-line); padding-left: 18px; }
.toc summary { list-style: none; cursor: pointer; font-family: var(--f-head); font-weight: 700; font-size: 15px; color: var(--c-ink-sub); min-height: 32px; }
.toc summary::-webkit-details-marker { display: none; }
.toc ol { list-style: none; margin: 8px 0 0; padding: 0; font-size: 14px; line-height: 1.6; }
.toc li { margin: 0; }
.toc a { display: block; padding: 6px 0; color: var(--c-ink-sub); text-decoration: none; transition: color .18s ease; }
.toc a:hover { color: var(--c-ink); }
.toc a.is-active { color: var(--c-accent-ink); font-weight: 700; }
.toc .toc__h3 a { padding-left: 14px; font-size: 13.5px; }

/* Content typography */
.content > :first-child { margin-top: 0; }
.content h2, .content h3, .content h4 { font-family: var(--f-head); font-weight: 700; letter-spacing: 0; color: var(--c-ink); }
.content h2 { font-size: 28px; line-height: 1.4; margin: 64px 0 20px; padding-left: 16px; border-left: 4px solid var(--c-accent); }
.content h3 { font-size: 22px; line-height: 1.45; margin: 44px 0 14px; display: flex; align-items: baseline; gap: 10px; }
.content h3::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--c-accent); transform: translateY(-2px); }
.content h4 { font-size: 18px; line-height: 1.5; margin: 32px 0 10px; color: var(--c-accent-ink); }
.content p { margin: 0 0 14px; }
.content strong { font-weight: 700; }
.content u { text-decoration-thickness: 1px; text-underline-offset: .2em; }
code.inline { font-family: var(--f-code); font-size: .9em; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 5px; padding: .1em .35em; }

/* Lists */
.list { margin: 0 0 18px; padding-left: 1.4em; }
.list li { margin: 4px 0; padding-left: .2em; }
.list li::marker { color: var(--c-accent); }
.steps { list-style: none; counter-reset: step; margin: 0 0 18px; padding: 0; }
.steps > li { counter-increment: step; position: relative; padding-left: 44px; margin: 10px 0; min-height: 30px; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: .15em; width: 30px; height: 30px; border-radius: 50%; background: var(--c-accent-ink); color: var(--c-white); font-family: Inter, sans-serif; font-weight: 700; font-size: 15px; line-height: 30px; text-align: center; letter-spacing: 0; }
.steps > li > :last-child, .list > li > :last-child { margin-bottom: 0; }

/* Callout */
.callout { display: flex; gap: 14px; margin: 20px 0; padding: 18px 20px; background: var(--c-note); border: 1px solid var(--c-note-line); border-radius: var(--r-lg); }
.callout__icon { flex: none; width: 24px; height: 24px; margin-top: 3px; color: var(--c-accent-ink); }
.callout__body { min-width: 0; }
.callout__body > :last-child { margin-bottom: 0; }

/* Columns */
.columns { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: 24px; margin: 20px 0; }
.column > :first-child { margin-top: 0; }
.column > :last-child { margin-bottom: 0; }

/* Figure */
.figure { margin: 22px 0; }
.zoom { display: block; width: 100%; padding: 0; border: 1px solid var(--c-line); border-radius: var(--r-md); background: var(--c-white); overflow: hidden; cursor: zoom-in; box-shadow: var(--shadow-1); transition: box-shadow .18s ease, transform .18s ease; }
.zoom img { width: 100%; }
.zoom:hover { box-shadow: var(--shadow-2); }
.zoom:active { transform: scale(.995); }
.columns .zoom img { max-height: 520px; object-fit: contain; background: var(--c-white); }
.figure figcaption { margin-top: 8px; font-size: 14px; line-height: 1.7; color: var(--c-ink-sub); }

/* Bookmark */
.bookmark { position: relative; display: grid; gap: 2px; margin: 18px 0; padding: 16px 52px 16px 18px; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg); color: var(--c-ink); text-decoration: none; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.bookmark:hover { border-color: var(--c-accent); box-shadow: var(--shadow-2); transform: translateY(-2px); }
.bookmark:active { transform: translateY(0); }
.bookmark__title { font-weight: 700; line-height: 1.6; }
.bookmark__desc { font-size: 14px; line-height: 1.7; color: var(--c-ink-sub); }
.bookmark__url { font-size: 13px; color: var(--c-accent-ink); letter-spacing: .02em; }
.bookmark svg { position: absolute; right: 18px; top: 50%; width: 20px; height: 20px; margin-top: -10px; color: var(--c-accent-ink); }

/* Embed */
.embed { margin: 22px 0; }
.embed__frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--c-line); background: var(--c-surface); }
.embed__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.embed__link { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; }

/* Code */
.code { position: relative; margin: 20px 0; }
.code pre { margin: 0; padding: 20px 20px 20px; padding-top: 48px; background: var(--c-code-bg); color: var(--c-code-ink); border-radius: var(--r-md); overflow-x: auto; font-family: var(--f-code); font-size: 14px; line-height: 1.75; letter-spacing: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.code__copy { position: absolute; top: 8px; right: 8px; min-height: 36px; min-width: 72px; padding: 0 14px; border: 1px solid rgba(var(--c-bg-rgb), .25); border-radius: var(--r-sm); background: transparent; color: var(--c-code-ink); font: inherit; font-size: 13px; cursor: pointer; transition: background .18s ease; }
.code__copy:hover { background: rgba(var(--c-bg-rgb), .12); }
.code__copy:active { background: rgba(var(--c-bg-rgb), .2); }
.code__copy:disabled { opacity: .5; cursor: default; }
.code__copy.is-copied { color: var(--c-accent); border-color: var(--c-accent); }

/* Page card */
.page-card { position: relative; display: grid; gap: 2px; margin: 22px 0; padding: 20px 60px 20px 22px; background: var(--c-white); border: 1px solid var(--c-line); border-radius: var(--r-lg); color: var(--c-ink); text-decoration: none; box-shadow: var(--shadow-1); transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.page-card:hover { border-color: var(--c-accent); box-shadow: var(--shadow-2); transform: translateY(-2px); }
.page-card:active { transform: translateY(0); }
.page-card__label { font-size: 13px; color: var(--c-accent-ink); font-weight: 700; }
.page-card__title { font-family: var(--f-head); font-size: 19px; font-weight: 700; line-height: 1.5; }
.page-card svg { position: absolute; right: 20px; top: 50%; width: 26px; height: 26px; margin-top: -13px; color: var(--c-accent); transition: transform .18s ease; }
.page-card:hover svg { transform: translateX(3px); }

.divider { border: 0; border-top: 1px solid var(--c-line); margin: 36px 0; }
.content blockquote { margin: 18px 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--c-line); color: var(--c-ink-sub); }

/* Notion colors */
.tc-gray { color: #787774; } .tc-brown { color: #9f6b53; } .tc-orange { color: #d9730d; } .tc-yellow { color: #b8860b; }
.tc-green { color: #448361; } .tc-blue { color: #337ea9; } .tc-purple { color: #9065b0; } .tc-pink { color: #c14c8a; } .tc-red { color: #d44c47; }
mark { color: inherit; padding: 0 .15em; border-radius: 3px; }
.bg-gray { background: #f1f1ef; } .bg-brown { background: #f4eeee; } .bg-orange { background: #fbecdd; } .bg-yellow { background: #fbf3db; }
.bg-green { background: #edf3ec; } .bg-blue { background: #e7f3f8; } .bg-purple { background: #f6f3f9; } .bg-pink { background: #faf1f5; } .bg-red { background: #fdebec; }

/* Pager */
.pager { max-width: var(--w-max); margin: 0 auto; padding: 24px var(--gutter) 64px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pager a { display: grid; gap: 2px; padding: 18px 22px; border: 1px solid var(--c-line); border-radius: var(--r-lg); color: var(--c-ink); text-decoration: none; transition: border-color .18s ease, box-shadow .18s ease; }
.pager a:hover { border-color: var(--c-accent); box-shadow: var(--shadow-2); }
.pager span { font-size: 13px; color: var(--c-ink-sub); }
.pager strong { font-family: var(--f-head); font-size: 17px; line-height: 1.5; }
.pager__next { grid-column: 2; text-align: right; }

/* Footer */
.site-footer { border-top: 1px solid var(--c-line); background: var(--c-surface); text-align: center; padding: 28px var(--gutter); font-size: 14px; color: var(--c-ink-sub); }
.site-footer p { margin: 0; }

/* Lightbox */
.lightbox { padding: 0; border: 0; background: transparent; max-width: 94vw; max-height: 92vh; overflow: visible; }
.lightbox::backdrop { background: rgba(var(--c-ink-rgb), .82); }
.lightbox__img { max-width: 94vw; max-height: 88vh; width: auto; border-radius: var(--r-md); box-shadow: var(--shadow-3); background: var(--c-white); }
.lightbox__close { position: fixed; top: 16px; right: 16px; width: 48px; height: 48px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--c-white); color: var(--c-ink); cursor: pointer; box-shadow: var(--shadow-2); }
.lightbox__close:hover { background: var(--c-accent-soft); }
.lightbox__close svg { width: 22px; height: 22px; }

/* 404 */
.notfound { text-align: center; padding: 40px 0; }

/* Reveal (L1): 本文は常に表示し、ページ見出しだけ柔らかく入場させる */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.page-hero__inner { animation: rise .5s ease-out both; }

/* Responsive */
@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 32px; }
  .layout > .toc { grid-column: 1; grid-row: 1; margin-bottom: 32px; }
  .content { grid-row: 2; }
  .toc details { position: static; border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: 12px 18px; background: var(--c-surface); }
  .toc summary { min-height: 44px; display: flex; align-items: center; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .columns { grid-template-columns: minmax(0, 1fr); }
  .page-title { font-size: 28px; }
  .content h2 { font-size: 23px; margin-top: 52px; }
  .content h3 { font-size: 19px; }
  .content h4 { font-size: 17px; }
  .site-header__inner { flex-wrap: wrap; gap: 0; padding-top: 6px; }
  .site-nav { margin-left: -14px; width: calc(100% + 14px); }
  .pager { grid-template-columns: 1fr; }
  .pager__next { grid-column: 1; }
}
@media (max-width: 480px) {
  :root { --gutter: 16px; }
  .page-hero__inner { padding: 32px var(--gutter) 28px; }
  .callout { padding: 14px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  .site-header, .toc, .pager, .code__copy, .lightbox { display: none !important; }
}
