:root {
  color-scheme: light dark;
  --font-family: "Avenir Next", Avenir, "Helvetica Neue", "PingFang SC", sans-serif;
  font-family: var(--font-family);
  font-size: 16px;
  font-weight: 400;
  color: var(--text);
  background: var(--background);
  font-synthesis: none;
  --background: #fff;
  --surface: #fff;
  --text: #282828;
  --secondary: #737373;
  --quiet: #878787;
  --faint: #aaa;
  --line: #e9e9e9;
  --soft: #f4f4f4;
  --hover: #1670c5;
  --focus: #8ab7de;
  --backdrop: rgb(0 0 0 / 24%);
}
html[data-theme="dark"] {
  color-scheme: dark;
  --background: #111211;
  --surface: #171817;
  --text: #ededeb;
  --secondary: #a7aaa5;
  --quiet: #858984;
  --faint: #777b76;
  --line: #31332f;
  --soft: #20221f;
  --hover: #69aaf0;
  --focus: #5591ca;
  --backdrop: rgb(0 0 0 / 55%);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--background); transition: background-color .3s ease, color .3s ease; }
html { scroll-behavior: smooth; scroll-padding-top: 32px; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
a, button { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--focus); outline-offset: 5px; border-radius: 2px; }
a:hover, button:hover { color: var(--hover); }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; font-size: inherit; font-weight: 400; }
.page { width: calc(100% - 48px); max-width: 640px; margin: 0 auto; padding: 112px 0 54px; }
.reading-progress { position: fixed; z-index: 6; inset: 0 0 auto; height: 2px; background: transparent; pointer-events: none; }
.reading-progress span { display: block; width: 100%; height: 100%; background: var(--text); transform: scaleX(0); transform-origin: left center; will-change: transform; }
.page-tools { position: fixed; z-index: 5; inset: 0 0 auto; height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 max(24px, calc((100% - 760px) / 2)); border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent); background: color-mix(in srgb, var(--background) 90%, transparent); backdrop-filter: blur(14px); }
.theme-toggle { display: flex; align-items: center; gap: 9px; border: 0; border-radius: 4px; background: transparent; padding: 7px; color: var(--quiet); font-size: 12px; line-height: 1; transition: color .18s ease, background-color .18s ease, transform .18s ease; }
.theme-symbol { position: relative; display: block; width: 18px; height: 18px; }
.theme-symbol i { position: absolute; inset: 3px; display: block; transition: opacity .22s, transform .3s; }
.sun { border: 1px solid currentColor; border-radius: 50%; box-shadow: 0 -5px 0 -4px, 0 5px 0 -4px, 5px 0 0 -4px, -5px 0 0 -4px; }
.moon { border-radius: 50%; border: 1px solid currentColor; clip-path: inset(0 0 0 46%); transform: rotate(-28deg); opacity: 0; }
html[data-theme="dark"] .sun { opacity: 0; transform: rotate(45deg) scale(.7); }
html[data-theme="dark"] .moon { opacity: 1; transform: rotate(-28deg) scale(1); }
.section-nav { display: flex; align-items: center; gap: 26px; }
.section-nav button { position: relative; border: 0; background: transparent; padding: 8px 0; color: var(--quiet); font-size: 12px; transition: color .18s ease; }
.section-nav button::after { content: ""; position: absolute; right: 100%; bottom: 3px; left: 0; height: 1px; background: currentColor; transition: right .2s ease; }
.section-nav button:hover::after, .section-nav button:focus-visible::after, .section-nav button.active::after { right: 0; }
.section-nav button.active { color: var(--text); }
.intro { margin-bottom: 104px; }
.intro h1 { font-size: 18px; line-height: 1.5; letter-spacing: -.25px; overflow-wrap: anywhere; }
#profile-name, #footer-name { text-transform: uppercase; }
.headline { margin-top: 7px; color: var(--text); font-size: 17px; font-weight: 400; line-height: 1.75; letter-spacing: -.15px; overflow-wrap: anywhere; }
.intro-text { max-width: 480px; margin-top: 30px; color: var(--quiet); font-size: 14px; line-height: 2; overflow-wrap: anywhere; }
.intro-text a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.intro-text a:hover { color: var(--hover); }
.section { margin-bottom: 88px; }
.section-title { margin-bottom: 27px; color: var(--quiet); font-size: 14px; line-height: 1.5; }
.count { margin-left: 7px; font-size: 12px; color: #929292; }
.project-list { display: grid; gap: 37px; }
.project-entry { min-width: 0; }
.project-title { line-height: 1.6; }
.project-open { position: relative; background: none; border: 0; border-radius: 3px; padding: 3px 0; text-align: left; line-height: 1.6; overflow-wrap: anywhere; transition: color .18s ease, background-color .18s ease, box-shadow .18s ease, transform .15s ease; }
.project-open::after, .note-open::after { content: ""; position: absolute; left: 0; right: 100%; bottom: 1px; height: 1px; background: currentColor; transition: right .22s ease; }
.project-open:hover::after, .project-open:focus-visible::after, .note-open:hover::after, .note-open:focus-visible::after { right: 0; }
.project-open:active, .note-open:active { transform: translateY(1px); }
.project-description { margin-top: 8px; max-width: 520px; font-size: 15px; line-height: 1.85; color: var(--secondary); overflow-wrap: anywhere; }
.project-description > :first-child { margin-top: 0; }
.project-description > :last-child { margin-bottom: 0; }
.project-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; margin-top: 12px; color: var(--quiet); font-size: 13px; line-height: 1.8; }
.project-meta > * + *::before { content: "·"; margin-right: 12px; color: var(--faint); }
.project-meta a { text-decoration: underline; text-underline-offset: 3px; }
.sample-hint { font-size: 12px; color: #929292; line-height: 1.9; margin-top: -14px; }
.note-list { display: grid; gap: 23px; }
.note-entry { min-width: 0; }
.note-open { position: relative; border: 0; border-radius: 3px; background: none; padding: 3px 0; text-align: left; line-height: 1.7; overflow-wrap: anywhere; transition: color .18s ease, background-color .18s ease, box-shadow .18s ease, transform .15s ease; }
.note-meta { margin-top: 3px; color: var(--quiet); font-size: 13px; line-height: 1.7; }
.note-meta > * + *::before { content: "·"; margin: 0 8px; color: var(--faint); }
.prose { overflow-wrap: anywhere; }
.about .markdown-body { color: var(--secondary); font-size: 15px; line-height: 2; max-width: 490px; }
.about .markdown-body p { margin-bottom: 18px; }
.about .markdown-body > :last-child { margin-bottom: 0; }
.contact { display: inline-block; margin-top: 22px; font-size: 14px; color: var(--secondary); text-decoration: underline; text-underline-offset: 4px; overflow-wrap: anywhere; }
.footer { margin-top: 8px; color: var(--quiet); font-size: 12px; line-height: 1.8; }
.footer-signature { display: inline-flex; align-items: center; gap: 7px; }
.footer-signature > span:first-child { font-size: 14px; filter: grayscale(1); }
.footer-motto::before { content: "·"; margin-right: 7px; color: var(--faint); }
.snail-route { position: relative; height: 54px; margin-top: 28px; overflow: hidden; border-bottom: 1px solid var(--line); }
.snail-trail { position: absolute; left: 3px; bottom: 7px; width: 0; height: 2px; border-radius: 999px; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--quiet) 35%, transparent) 10%, color-mix(in srgb, var(--quiet) 55%, transparent)); box-shadow: 0 1px 4px color-mix(in srgb, var(--quiet) 18%, transparent); opacity: 0; }
.snail-crawler { position: absolute; left: 0; bottom: 4px; display: block; width: 54px; height: 34px; color: var(--secondary); transform-origin: center bottom; }
.snail-crawler svg { display: block; width: 100%; height: 100%; overflow: visible; }
.snail-crawler path, .snail-crawler circle { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.snail-shell-lines, .snail-head-lines { transform-box: fill-box; transform-origin: center; }
.snail-route.walking .snail-crawler { animation: snail-crawl 36s linear .4s both, snail-breathe 3.8s ease-in-out .4s infinite; }
.snail-route.walking .snail-shell-lines { animation: shell-breathe 5.6s ease-in-out .4s infinite; }
.snail-route.walking .snail-head-lines { animation: head-sway 3.2s ease-in-out .4s infinite; }
.snail-route.walking .snail-trail { animation: snail-trail 36s linear .4s both; }
@keyframes snail-crawl {
  0% { left: 0; opacity: 0; }
  4% { opacity: 1; }
  96%, 100% { left: calc(100% - 54px); opacity: 1; }
}
@keyframes snail-breathe { 0%, 100% { transform: translateY(1px) scaleX(.99); } 50% { transform: translateY(0) scaleX(1.01); } }
@keyframes shell-breathe { 0%, 100% { transform: rotate(-1deg) translateY(0); } 50% { transform: rotate(1.5deg) translateY(-.5px); } }
@keyframes head-sway { 0%, 100% { transform: rotate(-1deg); } 50% { transform: rotate(2deg); } }
@keyframes snail-trail {
  0%, 4% { width: 0; opacity: 0; }
  8% { opacity: .7; }
  96%, 100% { width: calc(100% - 52px); opacity: .55; }
}
.loading, .empty-message { font-size: 14px; line-height: 1.8; color: var(--quiet); }
.load-error { margin: -40px 0 45px; font-size: 14px; line-height: 1.8; color: #9a5148; }
.load-error button { border: 0; background: none; padding: 8px 0; text-decoration: underline; text-underline-offset: 4px; }
.skip-link { position: fixed; left: 20px; top: -80px; z-index: 9; background: var(--surface); padding: 10px 15px; font-size: 14px; }
.skip-link:focus { top: 16px; }
dialog { width: min(1040px, calc(100% - 32px)); max-width: none; height: calc(100dvh - 32px); max-height: none; margin: auto; border: 1px solid var(--line); border-radius: 7px; padding: 0; background: var(--surface); color: var(--text); overscroll-behavior: contain; }
dialog::backdrop { background: var(--backdrop); backdrop-filter: blur(3px); }
.dialog-header { position: sticky; z-index: 2; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 66px; padding: 0 30px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 92%, transparent); color: var(--quiet); font-size: 12px; backdrop-filter: blur(12px); }
.close-detail { flex-shrink: 0; display: flex; align-items: center; gap: 12px; border: 0; background: none; padding: 8px 0 8px 12px; font-size: 13px; color: var(--secondary); }
.close-detail span { font-size: 21px; }
#detail-body { width: min(100% - 64px, 690px); margin: 0 auto; padding: 54px 0 88px; }
#detail-title { margin: 0 0 14px; color: var(--text); font-size: 22px; font-weight: 500; line-height: 1.65; letter-spacing: -.4px; }
.detail-summary { margin-bottom: 28px; font-size: 14px; line-height: 1.9; color: var(--quiet); }
.detail-disclaimer { margin-top: 32px; color: var(--quiet); font-size: 12px; line-height: 1.8; }
.detail-link { display: inline-block; margin-top: 25px; font-size: 14px; text-decoration: underline; text-underline-offset: 4px; }
.inline-project-link { margin-top: 0; }
#detail-body .markdown-body { color: var(--secondary); line-height: 1.95; }
#detail-body .markdown-body h1 { font-size: 23px; }
#detail-body .markdown-body h2 { font-size: 20px; }
#detail-body .markdown-body h3 { font-size: 18px; }
@media (hover: hover) and (pointer: fine) {
  .theme-toggle:hover, .section-nav button:hover, .close-detail:hover, .load-error button:hover { background: var(--soft); }
  .theme-toggle:hover { transform: translateY(-1px); }
  .project-open:hover, .note-open:hover { background: var(--soft); box-shadow: 8px 0 0 var(--soft), -8px 0 0 var(--soft); }
  .contact:hover, .footer a:hover, .project-meta a:hover, .detail-link:hover { text-decoration-thickness: 2px; text-underline-offset: 5px; }
  .close-detail { border-radius: 4px; transition: color .18s ease, background-color .18s ease; }
}
.modal-open { overflow: hidden; }
.observe-section { opacity: 0; transform: translateY(12px); transition: opacity .45s ease, transform .45s ease; }
.observe-section.in-view { opacity: 1; transform: none; }
.click-feedback { position: fixed; z-index: 20; left: 0; top: 0; width: 34px; height: 34px; border: 1px solid var(--hover); border-radius: 50%; pointer-events: none; opacity: 0; transform: translate(-50%, -50%) scale(.35); }
.click-feedback.show { animation: click-ring .42s ease-out; }
@keyframes click-ring { 0% { opacity: .75; transform: translate(-50%, -50%) scale(.25); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.2); } }
html[data-theme="dark"] .markdown-body { color: var(--secondary); }
html[data-theme="dark"] .markdown-body h1, html[data-theme="dark"] .markdown-body h2, html[data-theme="dark"] .markdown-body h3, html[data-theme="dark"] .markdown-body h4, html[data-theme="dark"] .markdown-body h5, html[data-theme="dark"] .markdown-body h6, html[data-theme="dark"] .markdown-body strong { color: var(--text); }
html[data-theme="dark"] .markdown-body a, html[data-theme="dark"] .intro-text a { color: #79b6f2; }
html[data-theme="dark"] .markdown-body code, html[data-theme="dark"] .intro-text code, html[data-theme="dark"] .markdown-body pre { background: var(--soft); color: #cbd0ca; }
html[data-theme="dark"] .markdown-body pre, html[data-theme="dark"] .markdown-body td, html[data-theme="dark"] .markdown-body th { border-color: var(--line); }
html[data-theme="dark"] .markdown-body th { background: var(--soft); }
@media (max-width: 640px) {
  .page { width: calc(100% - 48px); padding-top: 92px; padding-bottom: 70px; }
  .intro { margin-bottom: 72px; }
  .intro h1 { font-size: 17px; }
  .headline { margin-top: 6px; font-size: 16px; }
  .intro-text { margin-top: 25px; font-size: 13px; line-height: 2; }
  .section { margin-bottom: 66px; }
  .section-title { margin-bottom: 23px; }
  .project-list { gap: 32px; }
  .project-description { font-size: 14px; line-height: 1.9; }
  .project-meta { font-size: 12px; margin-top: 10px; }
  .sample-hint { font-size: 11px; }
  .note-list { gap: 21px; }
  .note-open { font-size: 15px; }
  .note-meta { font-size: 12px; }
  .about .markdown-body { font-size: 14px; }
  dialog { width: 100%; height: 100dvh; border: 0; border-radius: 0; }
  .dialog-header { min-height: 58px; padding: 0 20px; }
  #detail-body { width: calc(100% - 48px); padding: 36px 0 72px; }
  #detail-title { font-size: 21px; }
  .page-tools { height: 58px; gap: 14px; padding: 0 20px; overflow-x: auto; }
  .theme-toggle { padding: 7px 9px; }
  .theme-toggle #theme-label { display: none; }
  .section-nav { flex: 1; justify-content: space-between; gap: 15px; }
  .section-nav button { flex: 0 0 auto; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .observe-section { opacity: 1; transform: none; }
  .snail-route .snail-crawler { left: calc(100% - 54px); }
  .snail-route .snail-trail { width: calc(100% - 52px); opacity: .55; }
}
@media (hover: none), (pointer: coarse) { .click-feedback { display: none; } }
