:root {
  color-scheme: light;
  --ink: #20251e;
  --paper: #fcfbf7;
  --line: #d6d8cf;
  --green: #233b34;
  --lime: #e1ef8f;
  --slate: #cbd7ef;
  --peach: #f4c6ad;
  font-family: system-ui, 'Microsoft YaHei', sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button, .action, .outline { cursor: pointer; }
button, .outline, .action { display: inline-flex; align-items: center; gap: .65rem; padding: .65rem 1rem; border: 1px solid currentColor; background: transparent; line-height: 1.2; }
button:hover, .outline:hover { background: #e9ebdf; }
:focus-visible { outline: 3px solid #7050bf; outline-offset: 4px; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 4; background: white; padding: 1rem; }
.skip:focus { top: 1rem; }
.topbar { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: .9rem max(4vw, 1.3rem); border-bottom: 1px solid var(--line); }
.brand { display: flex; gap: .75rem; align-items: center; font-weight: 750; white-space: nowrap; }
.brand small { display: block; font: 10px/1.4 ui-monospace, monospace; letter-spacing: .12em; margin-top: .2rem; }
.stamp { display: grid; place-items: center; width: 42px; height: 42px; background: var(--green); color: var(--lime); font: bold 1.45rem ui-monospace, monospace; }
.topbar nav { display: flex; gap: clamp(.8rem, 3vw, 2.7rem); align-items: center; font-size: .92rem; white-space: nowrap; }
.topbar nav a { padding: .48rem 0; border-bottom: 2px solid transparent; }
.topbar nav a:hover, .topbar nav a[aria-current] { border-color: var(--green); }
kbd { font: .7rem ui-monospace, monospace; background: #e7e9df; padding: .2rem .35rem; white-space: nowrap; }
.eyebrow { font: 700 .75rem/1.25 ui-monospace, monospace; letter-spacing: .17em; margin: 0 0 1rem; }
h1, h2, h3, p { margin-top: 0; }
.collection, .catalog, .drafts { max-width: 90rem; margin: auto; padding: clamp(2rem, 5vw, 5rem) max(4vw, 1.3rem); }
.section-head { display: flex; gap: 1rem; justify-content: space-between; align-items: end; margin-bottom: 1.55rem; }
.section-head h2, .catalog h1, .drafts h1 { margin: 0; font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1.14; letter-spacing: -.05em; }
.section-head .eyebrow { color: #525d50; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem; }
.note-card { border: 1px solid var(--line); background: #fff; display: flex; flex-direction: column; min-height: 15rem; }
.card-head { display: block; padding: 1.1rem 1.2rem 1.2rem; background: var(--lime); }
.note-card[data-category="projects"] .card-head { background: var(--slate); }
.note-card[data-category="review"] .card-head { background: var(--peach); }
.card-head h3 { margin: .4rem 0 0; font-size: clamp(1.15rem, 2vw, 1.6rem); }
.category-label, time, .tags { font-size: .82rem; }
.card-body { padding: 1.1rem 1.2rem; flex: 1; display: flex; flex-direction: column; gap: 1rem; }
.card-body p { line-height: 1.65; margin-bottom: 0; }
.card-meta { color: #4a584b; margin-top: auto; display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; }
.card-head:hover h3, footer a:hover { text-decoration: underline; text-underline-offset: .22em; }
.controls { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; margin: 1.5rem 0; }
.language-index { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: .8rem; margin: 1.5rem 0; }
.language-link { display: flex; flex-direction: column; justify-content: end; gap: .4rem; min-height: 9rem; padding: clamp(1rem, 3vw, 1.65rem); border: 1px solid #20251e35; background: #deef32; color: #20251e; }
.language-link[data-subject="japanese"] { background: #29caf4; }
.language-link:hover strong { text-decoration: underline; text-underline-offset: .2em; }
.language-link strong { font-size: clamp(1.35rem, 3vw, 2rem); }
.language-label { font: 700 .78rem ui-monospace, monospace; letter-spacing: .12em; }
.catalog-back { display: inline-block; margin-bottom: .9rem; text-decoration: underline; text-underline-offset: .2em; }
.subject-empty { margin-top: 1.5rem; padding: 1.4rem; border: 1px solid var(--line); }
input, select, textarea { background: white; border: 1px solid #7e8878; padding: .65rem .8rem; border-radius: 0; }
input[type="search"] { width: min(100%, 26rem); }
.group + .group { margin-top: 2.5rem; }
.group h2 { border-bottom: 1px solid var(--line); padding-bottom: .65rem; }
.reading { max-width: 50rem; margin: auto; padding: clamp(2rem, 7vw, 6rem) max(4vw, 1.3rem); }
.reading h1 { font-size: clamp(2.2rem, 5vw, 4.2rem); margin: 1rem 0; line-height: 1.15; }
.reading .lead { font-size: 1.2rem; line-height: 1.7; }
.article-body { margin-top: 2rem; border-top: 1px solid var(--line); padding-top: 1rem; line-height: 1.85; overflow-wrap: anywhere; }
.article-body h2, .article-body h3 { margin: 1.35rem 0 .65rem; }
.article-body pre { padding: 1rem; background: #e8ece3; overflow: auto; }
footer { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: 1.2rem max(4vw, 1.3rem); border-top: 1px solid var(--line); }
footer span { margin-left: 1rem; color: #555f52; font-size: .875rem; }
footer a { font-size: .875rem; }
dialog { width: min(92vw, 39rem); max-height: 80vh; color: var(--ink); background: var(--paper); border: 1px solid var(--green); padding: 1.4rem; }
dialog::backdrop { background: #15221bb0; }
.dialog-head { display: flex; justify-content: space-between; align-items: start; gap: .8rem; }
.search-hit { display: flex; justify-content: space-between; align-items: center; padding: .8rem 0; border-bottom: 1px solid var(--line); gap: 1rem; }
.search-hit:hover { text-decoration: underline; }
.draft-form { display: grid; gap: .8rem; max-width: 44rem; }
.draft-form label { display: grid; gap: .35rem; }
.draft-form label[hidden] { display: none; }
.draft-form textarea { min-height: 8rem; resize: vertical; }
.draft-form textarea[name="body"] { min-height: 15rem; }
.draft-list { display: grid; gap: .65rem; max-width: 44rem; margin: 1.5rem 0; }
.draft-row { display: flex; gap: .7rem; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: .65rem; }
.draft-row strong { margin-right: auto; overflow-wrap: anywhere; }
.draft-row button { white-space: nowrap; }
.strong { background: var(--green); color: white; }
.strong:hover { background: #365b50; }
.muted { color: #4d5b4e; }
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; gap: .5rem; }
  .topbar nav { order: 3; width: 100%; padding-top: .35rem; justify-content: space-between; }
  .card-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
}
@media (max-width: 400px) { footer span { display: none; } kbd { display: none; } }
