:root {
  color-scheme: light;
  --paper: #f8f9fa;
  --surface: #fff;
  --text: #202224;
  --muted: #666b70;
  --line: #d5d8db;
  --soft: #eef0f2;
  --blue: #214de5;
  --lime: #d3eb81;
  --signal: #b34730;
}
body:not(.light) {
  color-scheme: dark;
  --paper: #161718;
  --surface: #1d1f20;
  --text: #f0f1ef;
  --muted: #a9aeb2;
  --line: #3b3e40;
  --soft: #272a2c;
  --blue: #93b0ff;
  --lime: #d3eb81;
  --signal: #ff987d;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 100px; }
body { margin: 0; min-width: 320px; color: var(--text); background: var(--paper); font: 400 15px/1.8 "Noto Sans JP", system-ui, sans-serif; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
button, a, summary { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 5px; }
svg { width: 20px; height: 20px; flex-shrink: 0; }
.skip-link { position: fixed; z-index: 50; top: -80px; left: 16px; padding: 10px 20px; color: var(--surface); background: var(--text); }
.skip-link:focus { top: 10px; }
.masthead { position: sticky; top: 0; z-index: 15; height: 76px; background: var(--surface); border-bottom: 1px solid var(--line); }
.masthead-inner { max-width: 1120px; height: 100%; margin: auto; padding: 0 112px 0 32px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.wordmark { font: 600 25px/1 "IBM Plex Mono", monospace; text-decoration: none; }
.wordmark span { color: var(--blue); }
.masthead-note { color: var(--muted); font-size: 11px; }
.menu-button { position: fixed; top: 16px; right: max(20px, calc((100vw - 1056px) / 2)); z-index: 35; width: 44px; height: 44px; padding: 0; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; }
.menu-button:hover { background: var(--soft); }
.menu-close-icon, .nav-open .menu-open-icon { display: none; }
.nav-open .menu-close-icon { display: block; }
.nav-open .menu-button { right: 20px; }
.nav-backdrop { position: fixed; inset: 0; z-index: 25; background: rgb(0 0 0 / .28); border: 0; opacity: 0; visibility: hidden; transition: opacity .28s, visibility .28s; }
.nav-open { overflow: hidden; }
.nav-open .nav-backdrop { opacity: 1; visibility: visible; }
.drawer { position: fixed; z-index: 30; inset: 0 0 0 auto; width: min(380px, 100%); height: 100dvh; display: flex; flex-direction: column; overflow-y: auto; background: var(--surface); border-left: 1px solid var(--line); padding: 100px 32px 24px; transform: translateX(100%); visibility: hidden; transition: transform .34s ease, visibility .34s; }
.nav-open .drawer { transform: translateX(0); visibility: visible; }
.drawer-label { margin: 0 0 14px; color: var(--muted); font-size: 12px; }
.nav-links { display: grid; margin-bottom: 32px; flex-shrink: 0; counter-reset: nav; }
.nav-links a { display: flex; align-items: center; gap: 20px; min-height: 56px; padding: 10px 4px; border-bottom: 1px solid var(--line); text-decoration: none; font-weight: 500; }
.nav-links a::before { counter-increment: nav; content: "0" counter(nav); font: 500 11px/1 "IBM Plex Mono", monospace; color: var(--muted); }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--blue); }
.drawer-settings { margin-top: auto; padding-top: 24px; border-top: 1px solid var(--line); flex-shrink: 0; }
.view-counter { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 0 0 22px; font-size: 12px; color: var(--muted); }
.view-counter output { color: var(--text); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.theme-toggle { display: flex; align-items: center; justify-content: space-between; gap: 20px; width: 100%; padding: 10px 0; background: none; border: 0; font-size: 13px; }
.theme-icon { display: inline-flex; align-items: center; width: 44px; height: 26px; padding: 3px; border: 1px solid var(--muted); border-radius: 20px; background: var(--soft); }
.theme-icon::after { content: ""; width: 18px; height: 18px; border-radius: 50%; background: var(--text); transform: translateX(17px); transition: transform .26s; }
.light .theme-icon::after { transform: translateX(0); }
.site-version { margin: 24px 0 0; color: var(--muted); font: 400 10px/1.8 "IBM Plex Mono", monospace; }
.page { width: min(100%, 1120px); margin: auto; padding: 0 32px 32px; min-height: calc(100vh - 76px); }
#home { display: grid; grid-template-columns: 320px minmax(0, 1fr); grid-template-areas: "head head" "about gear" "links gear" "footer footer"; grid-template-rows: auto auto 1fr auto; column-gap: 64px; row-gap: 40px; }
.profile-head { grid-area: head; display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 54px 0 48px; margin: 0; border-bottom: 2px solid var(--text); }
.identity { min-width: 0; }
.profile-kicker { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 0 0 14px; font-size: 12px; color: var(--muted); }
.profile-kicker span:first-child { color: #283316; background: var(--lime); padding: 2px 8px; }
h1 { margin: 0; font-size: 38px; font-weight: 700; line-height: 1.5; overflow-wrap: anywhere; }
.identity h1 span { display: inline-block; }
h1:focus { outline: none; }
.handle { margin: 13px 0 0; color: var(--blue); font: 500 13px/1.5 "IBM Plex Mono", monospace; }
.avatar-frame { flex: 0 0 116px; padding: 8px; border: 1px solid var(--line); transform: translate3d(var(--background-x, 0px), var(--background-y, 0px), 0) rotate(3deg); background: var(--surface); }
.avatar { position: relative; width: 98px; height: 98px; overflow: hidden; background: var(--soft); }
.avatar img { position: absolute; width: 432.6%; max-width: none; height: auto; left: -11.6%; top: -128.3%; }
.avatar-caption { display: block; padding-top: 8px; font: 500 9px/1.4 "IBM Plex Mono", monospace; text-align: center; }
.panel { min-width: 0; align-self: start; scroll-margin-top: 100px; }
#about { grid-area: about; }
#gear { grid-area: gear; }
#links { grid-area: links; }
.panel summary { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 0 18px; border-bottom: 1px solid var(--text); list-style: none; cursor: pointer; font-size: 20px; font-weight: 600; }
.panel summary::-webkit-details-marker { display: none; }
.section-index { color: var(--blue); font: 500 12px/1 "IBM Plex Mono", monospace; }
.panel summary svg { margin-left: auto; width: 18px; transition: transform .26s; }
.panel:not([open]) summary svg { transform: rotate(-90deg); }
.rows { display: grid; }
.row { min-width: 0; display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 18px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.term { font-size: 12px; color: var(--muted); padding-top: 3px; }
.description { min-width: 0; font-size: 14px; line-height: 1.9; overflow-wrap: anywhere; }
#about .row { display: block; padding: 24px 0; }
#about .term { margin-bottom: 10px; }
#about .description { font-size: 14px; line-height: 2.05; }
#about .row:nth-child(2) { border-bottom: 0; border-left: 3px solid var(--signal); padding: 0 0 0 16px; margin: 24px 0 0; }
#about .row:nth-child(2) .term { color: var(--signal); }
#about .row:nth-child(2) .description { font-weight: 600; font-size: 17px; }
#about .row:last-child { border-bottom: 0; padding-bottom: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-block; max-width: 100%; overflow-wrap: anywhere; font-size: 13px; line-height: 1.6; }
#about .chip { color: var(--muted); }
#about .chip + .chip::before { content: "/"; margin-right: 8px; color: var(--line); }
#gear .chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; align-items: start; }
#gear .chip { padding: 9px 0; border-bottom: 1px dotted var(--line); }
#gear .chip.accent { color: var(--blue); font-weight: 700; }
.link-list { padding-top: 18px; }
.profile-link { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.profile-link strong { display: block; font-size: 19px; font-weight: 600; }
.profile-link small { color: var(--muted); font: 400 11px/1.6 "IBM Plex Mono", monospace; }
.profile-link > svg { width: 28px; height: 28px; color: var(--blue); transition: transform .26s; }
.profile-link:hover > svg { transform: translate(3px, -3px); }
footer { grid-area: footer; display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); margin-top: 12px; padding: 22px 0 0; color: var(--muted); font-size: 11px; }
.standalone-head { padding: 40px 0 32px; border-bottom: 2px solid var(--text); }
.standalone-head h1 { font-size: 32px; }
.home-link { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 26px; color: var(--muted); font-size: 12px; text-decoration: none; }
.home-link:hover { color: var(--blue); }
.home-link svg { width: 16px; }
.standalone-content { max-width: 800px; }
#developers .row { grid-template-columns: 120px minmax(0, 1fr); padding: 32px 0; }
#developers .description { font-size: 18px; }
.release-list { margin: 0; padding: 0; list-style: none; }
.release-list > li { padding: 30px 0; border-bottom: 1px solid var(--line); }
.release-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px 20px; }
.release-heading h2 { margin: 0; color: var(--blue); font: 600 22px/1.5 "IBM Plex Mono", monospace; }
.release-heading time { color: var(--muted); font-size: 12px; }
.release-changes { margin: 18px 0 0; padding-left: 20px; font-size: 14px; overflow-wrap: anywhere; }
.release-changes li + li { margin-top: 8px; }
@keyframes soft-entrance { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes menu-entrance { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: translateX(0); } }
.nav-open .nav-links a { animation: menu-entrance .48s ease-out backwards; }
.nav-open .nav-links a:nth-child(2) { animation-delay: .045s; }
.nav-open .nav-links a:nth-child(3) { animation-delay: .09s; }
.nav-open .nav-links a:nth-child(4) { animation-delay: .135s; }
.nav-open .nav-links a:nth-child(5) { animation-delay: .18s; }
.nav-open .nav-links a:nth-child(6) { animation-delay: .225s; }
.menu-button { transition: background .2s, border-color .2s, scale .15s; }
.menu-button:active { scale: .94; }
.panel summary, .profile-link { position: relative; }
.panel summary::after, .profile-link::after { content: ""; position: absolute; inset: auto 0 -1px; height: 2px; background: var(--blue); transform: scaleX(0); transform-origin: left; transition: transform .4s ease; pointer-events: none; }
.panel summary:focus-visible::after, .profile-link:focus-visible::after { transform: scaleX(1); }
.home-link svg { transition: transform .26s ease; }
@media (hover: hover) and (pointer: fine) {
  .panel summary:hover::after, .profile-link:hover::after { transform: scaleX(1); }
  .home-link:hover svg { transform: translateX(-4px); }
  .menu-button:hover { border-color: var(--blue); }
}
[data-view]:not([hidden]) > .profile-head, [data-view]:not([hidden]) > .panel, [data-view]:not([hidden]) > .standalone-head, [data-view]:not([hidden]) > .standalone-content { animation: soft-entrance .8s cubic-bezier(.22,1,.36,1) both; }
@media (max-width: 950px) {
  #home { grid-template-columns: 270px minmax(0, 1fr); column-gap: 36px; }
  h1 { font-size: 30px; }
  #gear .row { grid-template-columns: 1fr; gap: 8px; }
}
@media (max-width: 700px) {
  .masthead { height: 66px; }
  .masthead-inner { padding: 0 76px 0 20px; }
  .masthead-note { display: none; }
  .menu-button { top: 11px; right: 18px; }
  .page { padding: 0 20px 28px; }
  #home { display: flex; flex-direction: column; gap: 34px; }
  #home > * { width: 100%; }
  .profile-head { padding: 36px 0 32px; gap: 16px; }
  h1 { font-size: 25px; }
  .profile-kicker { font-size: 10px; gap: 8px; margin-bottom: 10px; }
  .profile-kicker span:last-child { display: none; }
  .handle { font-size: 11px; }
  .avatar-frame { flex-basis: 82px; padding: 5px; }
  .avatar { width: 70px; height: 70px; }
  .avatar-caption { font-size: 8px; padding-top: 6px; }
  .panel summary { font-size: 18px; }
  #about .row { padding: 18px 0; }
  #about .row:nth-child(2) { margin-top: 18px; padding: 0 0 0 14px; }
  #gear .row { grid-template-columns: 1fr; gap: 10px; padding: 20px 0; }
  #gear .chips { gap: 0 20px; }
  .drawer { width: min(360px, 100%); padding: 86px 24px 24px; }
  .nav-links a { min-height: 50px; }
  .standalone-head h1 { font-size: 26px; }
  #developers .row { grid-template-columns: 80px minmax(0, 1fr); gap: 12px; }
  #developers .description { font-size: 15px; }
  footer { font-size: 10px; flex-wrap: wrap; gap: 6px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .avatar-frame { transform: rotate(3deg); }
}
