:root {
  --bg: #f6f7f4;
  --surface: #ffffff;
  --text: #17201d;
  --muted: #65706b;
  --line: #dce2de;
  --brand: #096b58;
  --brand-dark: #064b3f;
  --accent: #dcefe9;
  --content: 760px;
  --wide: 1120px;
  color-scheme: light;
  font-family: Inter, "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-underline-offset: .18em; }
a:hover { color: var(--brand-dark); }
img, video, iframe { max-width: 100%; height: auto; }
button, input { font: inherit; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 100;
  padding: .6rem 1rem;
  color: white;
  background: var(--brand-dark);
}
.skip-link:focus { top: 1rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid color-mix(in srgb, var(--line), transparent 25%);
  background: color-mix(in srgb, var(--surface), transparent 5%);
  backdrop-filter: blur(12px);
}
.header-inner,
.footer-inner {
  width: min(calc(100% - 2rem), var(--wide));
  margin-inline: auto;
}
.header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}
.site-brand { display: grid; color: var(--text); text-decoration: none; line-height: 1.25; }
.site-title { font-size: 1.1rem; font-weight: 800; letter-spacing: .02em; }
.site-subtitle { color: var(--muted); font-size: .74rem; }
.site-nav { display: flex; align-items: center; gap: 1.25rem; }
.site-nav a, .search-open {
  border: 0;
  padding: .35rem 0;
  color: var(--text);
  background: transparent;
  text-decoration: none;
  cursor: pointer;
}
.site-nav a:hover, .search-open:hover { color: var(--brand); }
.nav-toggle { display: none; }

.site-main { min-height: calc(100vh - 190px); }
.page-shell {
  width: min(calc(100% - 2rem), var(--content));
  margin-inline: auto;
  padding-block: clamp(2.5rem, 7vw, 5.5rem);
}
.hero {
  margin-bottom: 4rem;
  padding: clamp(2rem, 6vw, 4rem);
  border-radius: 24px;
  background: linear-gradient(145deg, #e5f4ef, #f8fbf9 65%);
  box-shadow: 0 18px 55px rgba(21, 62, 50, .08);
}
.hero h1 { max-width: 16em; margin: .2rem 0 1rem; font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.25; }
.hero p:last-child { max-width: 42rem; margin-bottom: 0; color: #3b4d47; }
.eyebrow { margin: 0; color: var(--brand); font-size: .76rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.page-header { margin-bottom: 3rem; }
.page-header h1, .article-header h1 { margin: .35rem 0 1rem; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.3; letter-spacing: -.025em; }

.post-list { display: grid; gap: 1.25rem; }
.post-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1.6rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}
.post-card:has(.post-card-image) { grid-template-columns: 150px minmax(0, 1fr); }
.post-card-image { display: block; align-self: start; aspect-ratio: 1.25; overflow: hidden; border-radius: 10px; background: var(--accent); }
.post-card-image img { width: 100%; height: 100%; object-fit: cover; }
.post-card h2 { margin: .1rem 0 .6rem; font-size: 1.35rem; line-height: 1.45; }
.post-card h2 a { color: var(--text); text-decoration: none; }
.post-card h2 a:hover { color: var(--brand); }
.post-summary { color: #38443f; }
.post-summary > :first-child { margin-top: 0; }
.post-summary > :last-child { margin-bottom: 0; }
.post-meta { margin: 0 0 .4rem; color: var(--muted); font-size: .82rem; }
.taxonomy { display: flex; flex-wrap: wrap; gap: .4rem .7rem; margin: 1rem 0 0; padding: 0; list-style: none; font-size: .8rem; }
.taxonomy a { color: var(--muted); text-decoration: none; }

.article-header { margin-bottom: 3rem; }
.article-body { font-family: "Noto Serif JP", "Yu Mincho", YuMincho, serif; font-size: 1.06rem; }
.article-body h2, .article-body h3, .article-body h4 { font-family: Inter, "Noto Sans JP", "Yu Gothic", sans-serif; line-height: 1.45; scroll-margin-top: 100px; }
.article-body h2 { margin: 3.5rem 0 1.2rem; padding-bottom: .55rem; border-bottom: 2px solid var(--accent); font-size: 1.65rem; }
.article-body h3 { margin: 2.5rem 0 .8rem; font-size: 1.3rem; }
.article-body p, .article-body ul, .article-body ol, .article-body table, .article-body blockquote { margin-block: 1.15rem; }
.article-body img { display: block; margin: 2rem auto; border-radius: 8px; }
.article-body blockquote { margin-inline: 0; padding: .8rem 1.25rem; border-left: 4px solid var(--brand); background: var(--accent); }
.article-body .alert { margin-block: 1.25rem; padding: .9rem 1.1rem; border-left: 4px solid var(--brand); border-radius: 6px; background: var(--accent); }
.article-body .alert-warning { border-color: #b26a00; background: #fff2d9; }
.article-body .alert-success { border-color: #2c7a47; background: #e4f4e9; }
.article-body .alert-danger { border-color: #aa3434; background: #fbe8e8; }
.video-embed { position: relative; width: 100%; padding-top: 56.25%; overflow: hidden; border-radius: 10px; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.external-embed { padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-family: Inter, "Noto Sans JP", sans-serif; }
.article-body pre { overflow-x: auto; padding: 1rem; border-radius: 10px; background: #17201d; color: #f6f7f4; }
.article-body code { padding: .12em .35em; border-radius: 4px; background: #e8ece9; font-size: .9em; }
.article-body pre code { padding: 0; background: transparent; }
.article-body table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; font-family: Inter, "Noto Sans JP", sans-serif; font-size: .92rem; }
.article-body th, .article-body td { min-width: 9rem; padding: .75rem; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.article-body th { background: var(--accent); }
.post-navigation, .pagination { display: flex; justify-content: space-between; gap: 1.25rem; margin-top: 4rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.post-navigation a { max-width: 46%; }

.term-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1rem; }
.term-card { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-decoration: none; }
.term-card span { color: var(--muted); font-size: .82rem; }
.archive-list { margin: 0; padding: 0; list-style: none; }
.archive-list li { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 1rem; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.archive-list time { color: var(--muted); font-size: .85rem; }

.search-dialog { width: min(calc(100% - 2rem), 720px); max-height: min(80vh, 720px); padding: 1.25rem; border: 0; border-radius: 18px; box-shadow: 0 25px 90px rgba(0, 0, 0, .28); }
.search-dialog::backdrop { background: rgba(12, 25, 21, .65); backdrop-filter: blur(4px); }
.search-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-weight: 800; }
.search-header button { border: 0; color: var(--brand); background: transparent; cursor: pointer; }
#site-search { width: 100%; margin-top: 1rem; padding: .8rem 1rem; border: 1px solid #aeb9b4; border-radius: 10px; }
#site-search:focus { outline: 3px solid color-mix(in srgb, var(--brand), transparent 72%); border-color: var(--brand); }
.search-status { color: var(--muted); font-size: .85rem; }
.search-results { margin: 0; padding-left: 1.4rem; }
.search-results li { padding: .65rem .2rem; }
.search-results a { font-weight: 700; }
.search-results p { margin: .2rem 0 0; color: var(--muted); font-size: .85rem; }

.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner { display: flex; justify-content: space-between; gap: 2rem; padding-block: 2rem; color: var(--muted); font-size: .82rem; }
.footer-inner nav { display: flex; flex-wrap: wrap; gap: .8rem 1.3rem; }
.footer-inner p { margin: 0; }

@media (max-width: 760px) {
  .header-inner { min-height: 66px; flex-wrap: wrap; gap: .6rem; padding-block: .65rem; }
  .site-subtitle { display: none; }
  .nav-toggle { display: block; border: 1px solid var(--line); border-radius: 8px; padding: .35rem .65rem; background: var(--surface); }
  .site-nav { display: none; flex-basis: 100%; align-items: stretch; flex-direction: column; gap: 0; padding-bottom: .6rem; }
  .site-nav.is-open { display: flex; }
  .site-nav a, .search-open { padding: .55rem 0; text-align: left; }
  .post-card:has(.post-card-image) { grid-template-columns: 88px minmax(0, 1fr); }
  .post-card { padding: 1.1rem; }
  .post-card h2 { font-size: 1.12rem; }
  .post-summary { display: none; }
  .footer-inner { flex-direction: column; }
  .archive-list li { grid-template-columns: 1fr; gap: .15rem; }
}

@media print {
  .site-header, .site-footer, .post-navigation, .taxonomy { display: none; }
  .page-shell { width: 100%; padding: 0; }
  body { background: white; }
}
