:root {
  color-scheme: light;
  --paper: #f4f6f1;
  --white: #fdfefa;
  --ink: #182a23;
  --muted: #53665b;
  --rule: #d8e0d7;
  --green: #214d3d;
  --mint: #dceae0;
  --serif: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif CJK JP", "Noto Serif JP", serif;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
  line-height: 1.65;
  background: var(--paper);
  color: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
[hidden] { display: none !important; }
a { color: var(--green); text-underline-offset: .22em; }
a:hover { text-decoration-thickness: .13em; }
button, input { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #2b7657; outline-offset: 4px; }
.wrap { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; z-index: 2; top: .5rem; left: .5rem; padding: .5rem 1rem; background: var(--white); transform: translateY(-180%); }
.skip-link:focus { transform: translateY(0); }
.site-header { border-bottom: 1px solid var(--rule); }
.header-inner { height: 68px; display: flex; justify-content: space-between; align-items: center; }
.header-inner a { text-decoration: none; }
.header-inner nav a { font-size: .9rem; font-weight: 650; padding: .55rem 0; }
.header-inner nav a:hover { text-decoration: underline; }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--ink); font-weight: 750; letter-spacing: .08em; }
.brand-mark { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 8px; background: var(--green); }
.brand-mark span { width: 15px; height: 17px; border: 1.5px solid #f3f8ed; border-radius: 2px; position: relative; }
.brand-mark span::before { content: ""; display: block; position: absolute; left: 3px; top: 0; bottom: 0; border-left: 1px solid #f3f8ed; }
.brand-mark span::after { content: ""; display: block; position: absolute; height: 1px; width: 5px; background: #f3f8ed; top: 5px; left: 6px; }

.hero {
  display: flex;
  align-items: center;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin-top: 28px;
  min-height: 342px;
  border-radius: 20px;
  background: #132e26;
  color: #fffef6;
}
.hero::before, .hero::after { content: ""; position: absolute; inset: 0; z-index: -1; }
.hero::before { left: 25%; background: url("/assets/notebook.jpg") center 50% / cover no-repeat; }
.hero::after { background: linear-gradient(90deg, #132e26 10%, #132e26 29%, #132e26e8 37%, #132e2650 62%, transparent 82%); }
.hero-content { width: min(580px, 100%); padding: 42px clamp(32px, 6vw, 76px); }
.hero h1 { font: 700 clamp(2.9rem, 6vw, 4.5rem)/1.12 var(--serif); margin: 0 0 .35em; letter-spacing: .06em; }
.hero p { max-width: 22em; color: #edf3eb; font-size: 1.05rem; margin: 0; line-height: 1.85; }
.hero-link { display: inline-block; margin-top: 1.5rem; padding: .58rem 1.12rem; border-radius: 7px; background: #e5eddb; color: #1b3a2c; text-decoration: none; font-size: .92rem; font-weight: 700; }
.hero-link:hover { background: #f5faee; }
.hero-link:focus-visible { outline-color: #fffef6; }

.archive { margin-top: 46px; margin-bottom: 70px; scroll-margin-top: 1.3rem; }
.archive-header, .filter-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.archive h2 { font: 700 1.85rem/1.3 var(--serif); margin: 0; }
#filter-form { display: flex; align-items: center; position: relative; width: min(320px, 100%); }
#filter-form input { width: 100%; min-height: 44px; padding: .55rem .9rem .55rem 2.55rem; border: 1px solid #b8c8bd; border-radius: 8px; background: var(--white); color: var(--ink); font-size: .95rem; }
#filter-form input::placeholder { color: var(--muted); }
.search-icon { position: absolute; left: 1rem; width: 12px; height: 12px; border: 1.6px solid var(--green); border-radius: 50%; margin-bottom: 3px; pointer-events: none; }
.search-icon::after { content: ""; position: absolute; width: 6px; border-top: 1.6px solid var(--green); transform: rotate(45deg); top: 9px; left: 8px; }
.filter-row { margin: 1.05rem 0 1.15rem; }
.categories { display: flex; flex-wrap: wrap; gap: .5rem; }
.categories button { min-height: 40px; border: 1px solid var(--rule); border-radius: 20px; padding: .35rem .95rem; background: var(--white); color: var(--ink); font-size: .875rem; }
.categories button:hover { border-color: var(--green); }
.categories button[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: white; }
.result-count, .card-meta time { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; list-style: none; padding: 0; margin: 1.15rem 0 0; }
.card { background: var(--white); border: 1px solid var(--rule); border-radius: 13px; padding: 20px 22px; min-width: 0; position: relative; display: flex; flex-direction: column; }
.card:hover, .card:focus-within { border-color: #8ca99a; box-shadow: 0 5px 18px #24422d0b; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
.category { color: var(--green); font-size: .875rem; font-weight: 700; }
.card h3 { margin: .85rem 0 .35rem; font-size: 1.13rem; line-height: 1.6; overflow-wrap: anywhere; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; }
.card h3 a:hover { text-decoration: underline; }
.card p { margin: 0 0 .9rem; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: .35rem; padding: 0; list-style: none; margin: auto 0 0; }
.tags li { font-size: .86rem; padding: .12rem .51rem; border-radius: 5px; border: 1px solid var(--rule); color: var(--muted); overflow-wrap: anywhere; }
.empty { margin: 0; border: 1px dashed #a2b0a6; border-radius: 12px; padding: 1.25rem; color: var(--muted); }
.site-footer { border-top: 1px solid var(--rule); padding: 1.15rem 0; font-size: .87rem; color: var(--muted); }

.article-shell { max-width: 1010px; margin-bottom: 70px; }
.crumb { display: flex; gap: .65rem; align-items: baseline; margin-top: 24px; color: var(--muted); font-size: .9rem; }
.article-lead { padding: clamp(1.65rem, 5vw, 3.4rem); margin-top: 1.1rem; border-radius: 16px; background: #e4ede4; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.1rem; color: var(--muted); font-size: .875rem; }
.article-lead h1 { font: 700 clamp(1.875rem, 4.5vw, 3.25rem)/1.4 var(--serif); margin: .32em 0; overflow-wrap: anywhere; }
.article-lead p { color: #3c5447; font-size: 1.06rem; margin: 0 0 1.15rem; max-width: 43em; }
.article-lead .tags li { border-color: #bdcec2; }
.article-grid { display: grid; align-items: start; gap: clamp(1.5rem, 4.5vw, 3.35rem); grid-template-columns: minmax(145px, 215px) minmax(0, 1fr); margin-top: 2rem; }
.contents { position: sticky; top: 18px; border: 1px solid var(--rule); border-radius: 10px; background: var(--white); }
.contents nav { padding: .9rem; }
.contents p { font-weight: 700; margin: 0 0 .4rem; }
.contents ul { list-style: none; font-size: .875rem; margin: 0; padding: 0; }
.contents a { display: block; padding: .27rem 0; }
.reading { max-width: 45em; overflow-wrap: anywhere; }
.reading section { scroll-margin-top: 1.2rem; padding: 0 0 1.4rem; margin-bottom: 1.45rem; border-bottom: 1px solid var(--rule); }
.reading section:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.reading h2 { font: 700 1.55rem/1.55 var(--serif); margin: 0 0 .65rem; }
.reading p, .reading ul, .reading ol { margin: 0 0 1rem; line-height: 1.9; }
.reading ul, .reading ol { padding-left: 1.5rem; }
.reading li + li { margin-top: .35rem; }
.reading .references { font-size: .875rem; color: var(--muted); margin-bottom: 0; }
.references a { display: inline-block; min-width: 1.55rem; text-align: center; padding: .05em .18em; border-radius: 4px; background: var(--mint); }
.source-list li { scroll-margin-top: 1rem; }
.source-list li:target { background: var(--mint); }
.not-found { padding: 3rem 0; }

@media (max-width: 740px) {
  .wrap { width: calc(100% - 32px); }
  .header-inner { height: 58px; }
  .hero { margin-top: 18px; min-height: 300px; }
  .hero::before { left: 12%; background-position: 58% center; }
  .hero::after { background: linear-gradient(90deg, #132e26 11%, #132e26df 46%, #132e2655 100%); }
  .hero-content { padding: 32px 24px; }
  .hero p { max-width: 20em; }
  .archive { margin-top: 33px; }
  .article-grid { grid-template-columns: minmax(0, 1fr); }
  .contents { position: static; }
}
@media (max-width: 540px) {
  .archive-header { align-items: stretch; flex-direction: column; }
  #filter-form { width: 100%; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 17px; }
  .reading h2 { font-size: 1.35rem; }
}
