:root {
  --blue: #1b3fd8;
  --blue-deep: #102cae;
  --ink: #17191f;
  --muted: #616773;
  --faint: #8a909b;
  --line: #e6e8ed;
  --soft: #f5f7ff;
  --paper: #ffffff;
  --home-background: #faf9f6;
  --serif: "Iowan Old Style", "Songti SC", "STSong", Georgia, serif;
  --sans: "Avenir Next", Avenir, "PingFang SC", "Hiragino Sans GB", sans-serif;
  --mono: "SFMono-Regular", Menlo, Consolas, monospace;
  --width: 820px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
.home-page { background: var(--home-background); }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 4px; }
a:focus-visible { outline: 3px solid rgba(27, 63, 216, .3); outline-offset: 4px; }
::selection { background: rgba(27, 63, 216, .16); color: var(--ink); }

.wrap { width: min(var(--width), calc(100% - 48px)); margin-inline: auto; }

.nav { border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .94); }
.nav-in {
  width: min(var(--width), calc(100% - 48px));
  height: 68px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.02em;
}
.nav-logo:hover { color: var(--blue); text-decoration: none; }
.nav-links { display: flex; gap: 26px; }
.nav-links a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}
.nav-links a:hover, .nav-links a.on { color: var(--blue); text-decoration: none; }

.hero { padding: 126px 0 132px; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .06em;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 5px rgba(27, 63, 216, .09); }
.hero h1 {
  max-width: 760px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(50px, 8vw, 78px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -.055em;
}
.hero h1 .em { color: var(--blue); }
.hero-tag {
  max-width: 700px;
  margin: 30px 0 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(22px, 3vw, 28px);
  line-height: 1.6;
  letter-spacing: -.02em;
}
.hero-intro { max-width: 660px; margin: 18px 0 0; color: var(--muted); font-size: 15px; line-height: 1.85; }
.hero-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 36px; }
.btn {
  min-height: 46px;
  padding: 0 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  background: var(--paper);
  font-size: 13px;
  transition: border-color .18s ease, color .18s ease, background .18s ease, transform .18s ease;
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { transform: translateY(-2px); border-color: var(--blue); color: var(--blue); text-decoration: none; }
.btn.primary { border-color: var(--blue); background: var(--blue); color: white; }
.btn.primary:hover { border-color: var(--blue-deep); background: var(--blue-deep); color: white; }

.sec { padding: 78px 0; border-top: 1px solid var(--line); }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 36px; }
.sec-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -.03em;
}
.sec-more { color: var(--muted); font-size: 13px; }
.sec-more:hover { color: var(--blue); }
.bio { max-width: 760px; }
.bio p { margin: 0 0 18px; color: var(--muted); font-size: 16px; line-height: 1.9; }
.bio p:first-child { color: var(--ink); font-family: var(--serif); font-size: 20px; line-height: 1.8; }
.bio p:last-child { margin-bottom: 0; }

.skill-row { display: grid; grid-template-columns: 125px minmax(0, 1fr); gap: 28px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.skill-row:first-of-type { border-top: 1px solid var(--line); }
.skill-group { padding-top: 5px; color: var(--ink); font-family: var(--serif); font-size: 16px; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 5px 10px; border: 1px solid #dce1f7; border-radius: 999px; background: var(--soft); color: #36405c; font-size: 12px; }

.proj { padding: 28px 0; border-bottom: 1px solid var(--line); }
.proj:first-of-type { border-top: 1px solid var(--line); }
.proj-top { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; }
.proj-name { margin: 0; color: var(--ink); font-family: var(--serif); font-size: 22px; font-weight: 600; line-height: 1.4; }
a.proj-name:hover { color: var(--blue); text-decoration: none; }
.proj-subtitle { flex: none; color: var(--faint); font-size: 12px; }
.proj-desc { max-width: 690px; margin: 10px 0 16px; color: var(--muted); font-size: 14px; }
.proj-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tag { color: var(--blue); font-family: var(--mono); font-size: 10px; }
.tag + .tag::before { content: "/"; margin-right: 7px; color: #c4c8d2; }

.work-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.work-card {
  min-width: 0;
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-rows: 210px auto;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.work-card:hover { transform: translateY(-3px); border-color: #cbd2ef; box-shadow: 0 16px 38px rgba(30, 38, 72, .08); text-decoration: none; }
.work-cover { position: relative; overflow: hidden; display: grid; place-items: center; border-bottom: 1px solid var(--line); }
.work-cover span { position: relative; z-index: 1; font-family: var(--serif); font-size: 66px; line-height: 1; }
.work-card-calligraphy .work-cover { background: #eee8dc; color: #24211d; }
.work-card-calligraphy .work-cover::before { content: ""; position: absolute; inset: 18px; border: 1px solid rgba(71, 63, 52, .2); }
.work-card-calligraphy .work-cover::after { content: ""; position: absolute; width: 150px; height: 150px; border-radius: 48% 52% 56% 44%; background: rgba(38, 35, 29, .06); transform: rotate(18deg); }
.work-card-photography .work-cover { background: #182747; color: #fff; }
.work-card-photography .work-cover::before { content: ""; position: absolute; width: 132px; height: 86px; border: 1px solid rgba(255, 255, 255, .45); }
.work-card-photography .work-cover::after { content: ""; position: absolute; width: 42px; height: 42px; border: 1px solid rgba(255, 255, 255, .75); border-radius: 50%; box-shadow: 72px -50px 0 -19px #fff; }
.work-copy { min-width: 0; padding: 22px 24px 24px; display: flex; flex-direction: column; }
.work-copy .work-en { margin-bottom: 7px; color: var(--blue); font-family: var(--mono); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; }
.work-copy strong { font-family: var(--serif); font-size: 21px; font-weight: 600; }
.work-copy > span:last-child { margin-top: 7px; color: var(--muted); font-size: 12px; line-height: 1.75; }
.work-arrow { position: absolute; right: 22px; bottom: 23px; color: var(--faint); font-size: 15px; transition: color .18s ease, transform .18s ease; }
.work-card:hover .work-arrow { color: var(--blue); transform: translate(2px, -2px); }

.agent-preview { padding: 34px 36px; display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; border: 1px solid var(--line); border-left: 3px solid var(--blue); background: var(--paper); }
.agent-preview > div { max-width: 570px; }
.agent-kicker, .page-kicker, .agent-status { display: block; color: var(--blue); font-family: var(--mono); font-size: 9px; letter-spacing: .12em; }
.agent-preview h3 { margin: 8px 0 8px; font-family: var(--serif); font-size: 21px; font-weight: 600; }
.agent-preview p { margin: 0; color: var(--muted); font-size: 13px; }
.agent-preview > a { flex: none; font-size: 12px; }

.page-head-wide { padding-bottom: 48px; }
.page-kicker { margin-bottom: 14px; }
.works-page-sec, .agents-page-sec { min-height: 430px; }
.work-detail-head .art-back { margin-bottom: 36px; }
.gallery-sec { min-height: 420px; }
.collection-empty, .agent-empty { min-height: 330px; padding: 64px 28px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid var(--line); text-align: center; background: var(--paper); }
.empty-mark { width: 82px; height: 82px; margin-bottom: 24px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--blue); font-family: var(--serif); font-size: 38px; }
.collection-empty h2, .agent-empty h2 { margin: 0 0 8px; font-family: var(--serif); font-size: 24px; font-weight: 600; }
.collection-empty p, .agent-empty p { max-width: 430px; margin: 0; color: var(--muted); font-size: 13px; }
.gallery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 18px; }
.gallery-item { margin: 0; }
.gallery-item img { width: 100%; aspect-ratio: 4 / 5; display: block; object-fit: cover; background: var(--soft); }
.gallery-item figcaption { padding-top: 11px; display: flex; justify-content: space-between; gap: 14px; font-size: 12px; }
.gallery-item figcaption span { color: var(--faint); }
.agent-terminal { margin-bottom: 22px; color: var(--blue); font-family: var(--mono); font-size: 42px; line-height: 1; }
.agent-empty .agent-kicker { margin-bottom: 9px; }
.agent-list { border-top: 1px solid var(--line); }
.agent-item { padding: 32px 0; display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 20px; border-bottom: 1px solid var(--line); }
.agent-number { color: var(--faint); font-family: var(--mono); font-size: 11px; }
.agent-item h2 { margin: 8px 0; font-family: var(--serif); font-size: 24px; }
.agent-item p { margin: 0 0 14px; color: var(--muted); font-size: 13px; }

.plist { display: flex; flex-direction: column; }
.pitem { display: block; padding: 25px 0; border-bottom: 1px solid var(--line); }
.pitem:first-child { border-top: 1px solid var(--line); }
.pitem:hover { text-decoration: none; }
.pitem-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 7px; color: var(--faint); font-family: var(--mono); font-size: 10px; }
.pitem-title { margin: 0 0 6px; color: var(--ink); font-family: var(--serif); font-size: 21px; font-weight: 600; line-height: 1.45; transition: color .18s ease; }
.pitem:hover .pitem-title { color: var(--blue); }
.pitem-sum { margin: 0; color: var(--muted); font-size: 13px; }

.page-head { padding: 86px 0 30px; }
.page-head h1 { margin: 0 0 12px; font-family: var(--serif); font-size: 48px; line-height: 1.2; letter-spacing: -.04em; }
.page-head p { margin: 0; color: var(--muted); font-size: 14px; }
.year-mark { padding: 34px 0 8px; border-bottom: 1px solid var(--ink); color: var(--blue); font-family: var(--mono); font-size: 11px; letter-spacing: .08em; }

.art-head { padding: 78px 0 34px; border-bottom: 1px solid var(--line); }
.art-back { display: inline-flex; margin-bottom: 28px; color: var(--muted); font-size: 12px; }
.art-head h1 { margin: 0 0 17px; font-family: var(--serif); font-size: clamp(34px, 6vw, 52px); font-weight: 600; line-height: 1.25; letter-spacing: -.04em; }
.art-meta { display: flex; flex-wrap: wrap; gap: 9px; color: var(--faint); font-family: var(--mono); font-size: 10px; }
.art-body { padding: 44px 0 28px; font-family: var(--serif); font-size: 17px; }
.art-body h2 { margin: 48px 0 16px; font-size: 27px; line-height: 1.4; }
.art-body h3 { margin: 34px 0 12px; font-size: 21px; }
.art-body p { margin: 0 0 21px; color: #30333b; }
.art-body ul, .art-body ol { margin: 0 0 21px; padding-left: 26px; }
.art-body li { margin-bottom: 8px; }
.art-body img { max-width: 100%; }
.art-body blockquote { margin: 26px 0; padding: 5px 0 5px 20px; border-left: 3px solid var(--blue); color: var(--muted); }
.art-body code { padding: 2px 6px; border-radius: 3px; background: var(--soft); color: var(--blue-deep); font-family: var(--mono); font-size: .86em; }
.art-body pre { overflow-x: auto; margin: 0 0 24px; padding: 20px 22px; background: #161922; color: #eef0f8; font-family: var(--mono); font-size: 13px; line-height: 1.7; }
.art-body pre code { padding: 0; background: none; color: inherit; }
.art-body hr { margin: 40px 0; border: 0; border-top: 1px solid var(--line); }
.art-body table { width: 100%; margin-bottom: 24px; border-collapse: collapse; font-family: var(--sans); font-size: 13px; }
.art-body th, .art-body td { padding: 10px 13px; border: 1px solid var(--line); text-align: left; }
.art-body th { background: var(--soft); }
.art-nav { display: flex; justify-content: space-between; gap: 16px; padding: 34px 0; border-top: 1px solid var(--line); font-size: 13px; }
.art-nav a { max-width: 45%; }
.art-nav .nx { margin-left: auto; text-align: right; }

.foot { margin-top: 30px; padding: 28px 0 42px; border-top: 1px solid var(--line); color: var(--faint); font-size: 11px; }
.foot-in { display: flex; justify-content: space-between; gap: 16px; }
.foot a { color: var(--faint); }
.empty { padding: 38px 0; color: var(--faint); font-size: 14px; text-align: center; }

@media (max-width: 680px) {
  .wrap, .nav-in { width: min(var(--width), calc(100% - 40px)); }
  .nav-in { height: auto; padding-top: 5px; flex-wrap: wrap; }
  .nav-logo { width: 100%; min-height: 40px; }
  .nav-links { width: 100%; gap: 8px; justify-content: space-between; }
  .nav-links a { min-width: 44px; min-height: 44px; justify-content: center; }
  .hero { padding: 76px 0 86px; }
  .hero h1 { font-size: clamp(46px, 15vw, 62px); }
  .hero-tag { font-size: 21px; }
  .hero-intro { font-size: 14px; }
  .hero-links .btn { flex: 1 1 calc(50% - 8px); }
  .sec { padding: 58px 0; }
  .skill-row { grid-template-columns: 1fr; gap: 10px; }
  .proj-top { align-items: flex-start; flex-direction: column; gap: 3px; }
  .proj-subtitle { order: -1; }
  .work-grid, .gallery-grid { grid-template-columns: 1fr; }
  .work-card { grid-template-rows: 190px auto; }
  .agent-preview { padding: 28px 24px; align-items: flex-start; flex-direction: column; gap: 18px; }
  .agent-item { grid-template-columns: 42px minmax(0, 1fr); gap: 12px; }
  .page-head { padding-top: 58px; }
  .page-head h1 { font-size: 40px; }
  .art-head { padding-top: 52px; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f1f3f9;
    --muted: #abb1c0;
    --faint: #878e9e;
    --line: #2b2f3a;
    --soft: #20283f;
    --paper: #111319;
    --home-background: #111319;
    --blue: #6f8cff;
    --blue-deep: #91a5ff;
  }
  .nav { background: rgba(17, 19, 25, .94); }
  .chip { border-color: #354269; color: #d5dcf7; }
  .art-body p { color: #d2d6df; }
  .art-body pre { background: #08090d; }
}

@media (prefers-reduced-motion: no-preference) {
  .hero > * { animation: rise .55s ease both; }
  .hero > *:nth-child(2) { animation-delay: .05s; }
  .hero > *:nth-child(3) { animation-delay: .1s; }
  .hero > *:nth-child(4) { animation-delay: .15s; }
  .hero > *:nth-child(5) { animation-delay: .2s; }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
}
