/* Nari Web デザインシステムの値(デザイン案から転記) */
:root {
  --ink: #0c1319;
  --ink-muted: #57606a;
  --surface: #ffffff;
  --surface-alt: #f2f2f2;
  --line: #d0d7de;
  --on-inverse: #ffffff;
  --font-display: Montserrat, "Noto Sans JP", sans-serif;
  --font-sans: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", sans-serif;
  --shadow-card: 10px 12px 50px 0 rgba(0, 0, 0, .1);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--surface); color: var(--ink); font-family: var(--font-sans); -webkit-font-smoothing: antialiased; }
a { color: var(--ink); }
a:hover { color: var(--ink-muted); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
img { max-width: 100%; height: auto; display: block; }

.en { font-family: var(--font-display); font-weight: 700; letter-spacing: .05em; }
.wrap { max-width: 1024px; margin: 0 auto; padding: 0 24px; }
.alt { background: var(--surface-alt); }
.muted { color: var(--ink-muted); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--surface); padding: 8px 12px; z-index: 10; }

/* ヘッダー・フッター */
.site-header .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; padding-top: 28px; padding-bottom: 28px; }
.site-header .logo { font-size: 20px; text-decoration: none; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 32px; }
.site-header nav a { font-size: 16px; text-decoration: none; }
.site-header nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.site-footer { background: var(--ink); color: var(--on-inverse); padding: 56px 0; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.site-footer .copy { font-family: Montserrat, sans-serif; font-size: 14px; font-weight: 400; letter-spacing: .05em; }

/* 見出し */
.hero { padding: 80px 0 120px; }
.hero h1 { margin: 0; font-size: clamp(56px, 8vw, 120px); line-height: 1.2; overflow-wrap: anywhere; }
.lead { margin: 8px 0 0; font-size: 16px; font-weight: 700; letter-spacing: .1em; line-height: 2; }
.hero .lead { margin-top: 24px; }
.page-head { padding: 56px 0 80px; }
.page-head h1 { margin: 0; font-size: 60px; line-height: 1.4; overflow-wrap: anywhere; }
.page-head .eyebrow { margin: 0 0 8px; font-size: 14px; line-height: 1.6; color: var(--ink-muted); text-decoration: none; display: inline-block; }
.section { padding: 120px 0; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 40px; }
.section-head h2 { margin: 0; font-size: 60px; line-height: 1.4; }
.arrow-link { display: inline-flex; align-items: center; gap: 8px; font-size: 20px; line-height: 28px; text-decoration: none; min-height: 44px; }
.arrow-link:hover span { text-decoration: underline; }
.count { margin: 0; font-size: 14px; color: var(--ink-muted); }

@media (max-width: 600px) {
  .section { padding: 80px 0; }
  .section-head h2, .page-head h1 { font-size: 44px; }
  .site-header nav { gap: 20px; }
}

/* 記事の一覧 */
.post-list { list-style: none; margin: 0; padding: 0; }
.post-list.ruled { border-bottom: 1px solid var(--line); }
.post-list li { border-top: 1px solid var(--line); }
.post-list a { display: block; padding: 28px 0; text-decoration: none; }
.post-list a:hover .post-title { text-decoration: underline; }
.post-meta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.post-meta time { font-size: 14px; color: var(--ink-muted); }
.tag { display: inline-block; font-size: 13px; font-weight: 700; padding: 2px 10px; border-radius: 8px; background: var(--surface-alt); color: var(--ink); text-decoration: none; }
a.tag { padding: 6px 12px; }
a.tag:hover { color: var(--ink); text-decoration: underline; }
.post-title { display: block; margin-top: 10px; font-size: 22px; font-weight: 700; line-height: 1.6; }
.post-excerpt { display: block; margin-top: 8px; font-size: 15px; line-height: 1.9; color: var(--ink-muted); }

/* 記事一覧のレイアウト(本文と右側の Archive / Tags) */
.blog-layout { display: flex; flex-wrap: wrap; gap: 56px; align-items: flex-start; padding-top: 80px; padding-bottom: 120px; }
.blog-main { flex: 999 1 560px; min-width: 0; }
.blog-side { flex: 1 1 280px; display: flex; flex-direction: column; gap: 40px; }
.list-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; }
.to-archive { display: none; align-items: center; gap: 8px; min-height: 44px; font-size: 15px; font-weight: 700; text-decoration: none; }
@media (max-width: 943px) { .to-archive { display: inline-flex; } }
.month-group { margin-top: 48px; }
.month-group:first-of-type { margin-top: 32px; }
.month-group h2 { display: flex; align-items: center; gap: 16px; margin: 0 0 8px; }
.month-group h2 a { display: inline-flex; align-items: center; gap: 8px; font-size: 28px; text-decoration: none; }
.month-group h2 a:hover { text-decoration: underline; }
.month-group .more-in-month { margin: 0; padding: 16px 0 0; border-top: 1px solid var(--line); font-size: 14px; }
.flat-list { margin-top: 24px; }

.archive { background: var(--surface); border-radius: 24px; box-shadow: var(--shadow-card); padding: 40px; }
.side-title { margin: 0 0 16px; font-size: 24px; }
.archive .side-title { margin: 0; }
.archive .year { margin: 24px 0 8px; padding-left: 8px; font-size: 20px; line-height: 1.4; }
.month-grid { display: grid; grid-template-columns: repeat(4, 44px); gap: 8px; }
.cell { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 8px; font-size: 13px; font-weight: 700; text-decoration: none; background: var(--surface-alt); color: var(--ink); }
.cell.empty { background: transparent; color: var(--ink-muted); font-weight: 400; }
.cell[aria-current="page"], .chip[aria-current="page"] { background: var(--ink); color: var(--on-inverse); }
.archive .all-years-head { margin: 24px 0 8px; padding-left: 8px; font-size: 15px; line-height: 1.6; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; justify-content: center; height: 44px; min-width: 60px; padding: 0 12px; border-radius: 8px; font-size: 13px; text-decoration: none; background: var(--surface-alt); color: var(--ink); }
.chip:hover { color: var(--ink); text-decoration: underline; }

/* ページ送り */
.pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 56px; padding-top: 40px; border-top: 1px solid var(--line); }
.pager a, .pager span.cur { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; min-width: 44px; padding: 0 16px; border-radius: 8px; background: var(--surface-alt); color: var(--ink); font-size: 15px; text-decoration: none; }
.on-alt .pager a, .on-alt .pager span.cur { background: var(--surface); }
.pager span.cur { background: var(--ink) !important; color: var(--on-inverse); }
.pager .gap { min-width: 24px; text-align: center; color: var(--ink-muted); }
.adjacent { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-top: 56px; padding-top: 40px; border-top: 1px solid var(--line); }

/* 実験カード */
.lab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 24px; }
.lab-card { display: flex; flex-direction: column; gap: 16px; text-decoration: none; background: var(--surface); border-radius: 44px; padding: 24px; }
.lab-card:hover { color: var(--ink); }
.lab-card:hover .more span { text-decoration: underline; }
.thumb { aspect-ratio: 16 / 10; border-radius: 20px; background: var(--surface-alt); overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--ink-muted); font-size: 13px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.on-alt .lab-card .thumb { background: var(--surface-alt); }
.lab-card time { display: block; font-size: 13px; line-height: 1.6; color: var(--ink-muted); }
.clamp2 { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.lab-title { min-height: 51px; margin: 8px 0 0; font-size: 16px; font-weight: 700; line-height: 1.6; }
.more { align-self: flex-end; display: inline-flex; align-items: center; gap: 8px; font-size: 20px; line-height: 28px; }
.lab-card .more { margin-top: 24px; }
.lab-body { display: flex; flex-direction: column; padding: 0 0 8px; }

/* 成果物カード */
.work-list { display: flex; flex-direction: column; gap: 40px; }
.work-card { display: flex; flex-wrap: wrap; gap: 24px; align-items: stretch; text-decoration: none; background: var(--surface); border-radius: 44px; box-shadow: var(--shadow-card); padding: 24px; }
.work-card:hover { color: var(--ink); }
.work-card:hover .more span { text-decoration: underline; }
.work-card .thumb { flex: 3 1 320px; font-size: 14px; }
.work-info { flex: 2 1 280px; align-self: center; display: flex; flex-direction: column; padding: 16px; }
.work-info .text { min-height: 157px; }
.work-name { margin: 0; font-size: 40px; line-height: 1.2; overflow-wrap: anywhere; }
.work-desc { margin: 8px 0 0; font-size: 16px; font-weight: 700; letter-spacing: .1em; line-height: 1.6; }
.work-stack { margin: 8px 0 0; font-size: 13px; line-height: 1.6; color: var(--ink-muted); }
.work-card .more { margin-top: 32px; }

/* About */
.about { display: flex; align-items: flex-start; gap: 24px; max-width: 760px; }
.avatar { flex: none; width: 96px; height: 96px; border-radius: 50%; background: var(--surface); object-fit: cover; }
.about-body { flex: 1 1 auto; min-width: 0; padding-top: 5px; }
.about-name { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 16px; }
.about-name strong { font-size: 20px; letter-spacing: .05em; line-height: 1.2; }
.about-name span { font-size: 14px; line-height: 1.6; color: var(--ink-muted); }
.about-bio { margin: 16px 0 24px; font-size: 16px; line-height: 2; white-space: pre-wrap; }
.social { display: flex; flex-wrap: wrap; gap: 8px; margin-left: -10px; }
.social a { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; color: #000; }

/* 詳細ページ */
.detail { padding-top: 80px; padding-bottom: 120px; }
.detail .wrap { max-width: 808px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 16px; }
.detail-meta time { font-size: 14px; color: var(--ink-muted); }
.cover { border-radius: 20px; overflow: hidden; margin: 0 0 48px; background: var(--surface-alt); }
.link-row { display: flex; flex-wrap: wrap; gap: 24px; margin: 0 0 48px; }
.back { margin-top: 56px; padding-top: 40px; border-top: 1px solid var(--line); }

/* Markdown 本文 */
.prose { font-size: 16px; line-height: 2; overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose h2 { margin: 64px 0 16px; font-size: 28px; line-height: 1.5; }
.prose h3 { margin: 48px 0 12px; font-size: 22px; line-height: 1.5; }
.prose h4 { margin: 32px 0 8px; font-size: 18px; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre, .prose table, .prose figure { margin: 0 0 24px; }
.prose ul, .prose ol { padding-left: 1.5em; }
.prose li + li { margin-top: 4px; }
.prose blockquote { padding: 4px 0 4px 20px; border-left: 3px solid var(--line); color: var(--ink-muted); }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; background: var(--surface-alt); padding: 2px 6px; border-radius: 6px; }
.prose pre { background: var(--ink); color: #e6edf3; padding: 20px 24px; border-radius: 16px; overflow-x: auto; line-height: 1.7; }
.prose pre code { background: none; padding: 0; color: inherit; font-size: 14px; }
.prose img { border-radius: 16px; margin: 0 auto; }
.prose table { border-collapse: collapse; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 48px 0; }
.empty-state { padding: 40px 0; color: var(--ink-muted); }

/* Lab の一覧はページ全体を surface-alt にする(デザイン案に合わせる) */
body.on-alt { background: var(--surface-alt); }
body.on-alt .site-footer { margin-top: 0; }
.page-head .tag { background: var(--surface); }
